asciiduck-sssd-0.3.0/0000755006171200004550000000000012703530716014426 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/Gemfile0000644006171200004550000000026212703530242015713 0ustar kkirklanepicadmsource 'https://rubygems.org' gem 'rake' gem 'puppet-lint' gem 'rspec-puppet' gem 'puppetlabs_spec_helper' gem 'puppet-syntax' gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.6.0' asciiduck-sssd-0.3.0/tests/0000755006171200004550000000000012642755617015603 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/tests/init.pp0000644006171200004550000000077212642755617017115 0ustar kkirklanepicadm# The baseline for module testing used by Puppet Labs is that each manifest # should have a corresponding test manifest that declares that class or defined # type. # # Tests are then run by using puppet apply --noop (to check for compilation # errors and view a log of events) or by fully applying the test in a virtual # environment (to compare the resulting system state to the desired state). # # Learn more about module testing here: # http://docs.puppetlabs.com/guides/tests_smoke.html # include sssd asciiduck-sssd-0.3.0/Rakefile0000644006171200004550000000170512703530265016075 0ustar kkirklanepicadmrequire 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' require 'puppet-syntax/tasks/puppet-syntax' PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" PuppetLint.configuration.fail_on_warnings = true # Forsake support for Puppet 2.6.2 for the benefit of cleaner code. # http://puppet-lint.com/checks/class_parameter_defaults/ PuppetLint.configuration.send('disable_class_parameter_defaults') # http://puppet-lint.com/checks/class_inherits_from_params_class/ PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_only_variable_string') exclude_paths = [ "pkg/**/*", "vendor/**/*", "spec/**/*", ] PuppetLint.configuration.ignore_paths = exclude_paths PuppetSyntax.exclude_paths = exclude_paths desc "Run syntax, lint, and spec tests." task :test => [ :syntax, :lint, :spec, ] asciiduck-sssd-0.3.0/Gemfile.lock0000644006171200004550000000214212703530301016635 0ustar kkirklanepicadmGEM remote: https://rubygems.org/ specs: CFPropertyList (2.2.8) diff-lcs (1.2.5) facter (2.4.4) CFPropertyList (~> 2.2.6) hiera (1.3.4) json_pure json_pure (1.8.3) metaclass (0.0.4) mocha (1.1.0) metaclass (~> 0.0.1) puppet (3.6.2) facter (> 1.6, < 3) hiera (~> 1.0) json_pure rgen (~> 0.6.5) puppet-lint (1.1.0) puppet-syntax (2.0.0) rake puppetlabs_spec_helper (1.0.1) mocha puppet-lint puppet-syntax rake rspec-puppet rake (10.4.2) rgen (0.6.6) rspec (3.4.0) rspec-core (~> 3.4.0) rspec-expectations (~> 3.4.0) rspec-mocks (~> 3.4.0) rspec-core (3.4.1) rspec-support (~> 3.4.0) rspec-expectations (3.4.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.4.0) rspec-mocks (3.4.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.4.0) rspec-puppet (2.3.0) rspec rspec-support (3.4.1) PLATFORMS ruby DEPENDENCIES puppet (~> 3.6.0) puppet-lint puppet-syntax puppetlabs_spec_helper rake rspec-puppet asciiduck-sssd-0.3.0/manifests/0000755006171200004550000000000012703530367016421 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/manifests/install.pp0000644006171200004550000000037512642755617020446 0ustar kkirklanepicadm# == Class: sssd::install # # This is an internal class. # The main entry point for the module is the init class # class sssd::install { if $sssd::manage_package { package {$sssd::package_name: ensure => $sssd::package_ensure } } } asciiduck-sssd-0.3.0/manifests/init.pp0000644006171200004550000000612512642755617017742 0ustar kkirklanepicadm# == Class: sssd # # Main entry point for the module # # === Parameters # Refer to the README. # class sssd ( $manage_package = $sssd::params::manage_package, $package_name = $sssd::params::package_name, $package_ensure = $sssd::params::package_ensure, $manage_config = $sssd::params::manage_config, $config_path = $sssd::params::config_path, $config_owner = $sssd::params::config_owner, $config_group = $sssd::params::config_group, $config_mode = $sssd::params::config_mode, $config_source = $sssd::params::config_source, $config_content = $sssd::params::config_content, $config_template = $sssd::params::config_template, $manage_service = $sssd::params::manage_service, $service_name = $sssd::params::service_name, $service_ensure = $sssd::params::service_ensure, $service_enable = $sssd::params::service_enable, $services = $sssd::params::services, $domains = $sssd::params::domains, $reconnection_retries = $sssd::params::reconnection_retries, $re_expression = $sssd::params::re_expression, $full_name_format = $sssd::params::full_name_format, $try_inotify = $sssd::params::try_inotify, $krb5_rcache_dir = $sssd::params::krb5_rcache_dir, $default_domain_suffix = $sssd::params::default_domain_suffix, $rotate_uris = $sssd::params::rotate_uris, $nss_options = $sssd::params::nss_options, $pam_options = $sssd::params::pam_options, $sudo_options = $sssd::params::sudo_options, $autofs_options = $sssd::params::autofs_options, $ssh_options = $sssd::params::ssh_options, $sss_cache_path = $sssd::params::sss_cache_path, $flush_cache_on_change = $sssd::params::flush_cache_on_change, $unsupported = $sssd::params::unsupported, $override_unsupported = $sssd::params::override_unsupported, ) inherits sssd::params { if $sssd::unsupported and ! $sssd::override_unsupported { fail("Unsupported OS ${::operatingsystem} ${::operatingsystemrelease}") } validate_bool($manage_package) if !is_array($package_name) { validate_string($package_name) } validate_re($package_ensure,['^(present|absent|latest)$','^(\d+\.)*\d+$']) validate_bool($manage_config) validate_absolute_path($config_path) validate_string($config_owner) validate_string($config_group) validate_re($config_mode,['^[0-7]{3,4}$']) validate_string($config_source) validate_string($config_content) validate_string($config_template) validate_bool($manage_service) validate_string($service_name) validate_re($service_ensure,['^(running|stopped)$']) validate_bool($service_enable) validate_bool($rotate_uris) validate_array($services) validate_hash($domains) validate_hash($nss_options) validate_hash($pam_options) validate_hash($sudo_options) validate_hash($autofs_options) validate_hash($ssh_options) validate_array($sss_cache_path) validate_bool($flush_cache_on_change) validate_bool($unsupported) validate_bool($override_unsupported) anchor { 'sssd::begin': } -> class { 'sssd::install': } -> class { 'sssd::config': } ~> class { 'sssd::service': } -> anchor { 'sssd::end': } } asciiduck-sssd-0.3.0/manifests/config.pp0000644006171200004550000000125212642755617020240 0ustar kkirklanepicadm# == Class: sssd::config # # This is an internal class. # The main entry point for the module is the init class # class sssd::config inherits sssd { if $sssd::manage_config { if $sssd::config_source == '' { file { $sssd::config_path: owner => $sssd::config_owner, group => $sssd::config_group, mode => $sssd::config_mode, content => pick($sssd::config_content,template($sssd::config_template)) } } else { file { $sssd::config_path: owner => $sssd::config_owner, group => $sssd::config_group, mode => $sssd::config_mode, source => $sssd::config_source, } } } } asciiduck-sssd-0.3.0/manifests/params.pp0000644006171200004550000000431612703530043020240 0ustar kkirklanepicadm# == Class: sssd::params # # This is an internal class. # The main entry point for the module is the init class # class sssd::params { case $::osfamily { 'RedHat': { $unsupported = false $manage_package = true $package_name = ['sssd-common','sssd-client','sssd-ldap'] $package_ensure = 'present' $manage_config = true $config_path = '/etc/sssd/sssd.conf' $config_owner = 'root' $config_group = 'root' $config_mode = '0600' $manage_service = true $service_name = 'sssd' $service_ensure = 'running' $service_enable = true $sss_cache_path = [ '/usr/sbin/' ] } 'Debian': { case $::operatingsystem { 'Ubuntu': { # Check that we're running 14.04 or newer if versioncmp($::operatingsystemrelease, '14.04') >= 0 { $unsupported = false } else { $unsupported = true } } 'Debian': { if versioncmp("${::operatingsystemrelease}", '8.0') >= 0 { $unsupported = false } else { $unsupported = true } } default: { $unsupported = true } } $manage_package = true $package_name = ['sssd','sssd-ldap','sssd-tools'] $package_ensure = 'present' $manage_config = true $config_path = '/etc/sssd/sssd.conf' $config_owner = 'root' $config_group = 'root' $config_mode = '0600' $manage_service = true $service_name = 'sssd' $service_ensure = 'running' $service_enable = true $sss_cache_path = [ '/usr/sbin/' ] } default: { $unsupported = true } } $override_unsupported = false $config_source = '' $config_content = '' $config_template = 'sssd/sssd.conf.erb' $services = ['nss','pam'] $domains = { 'local' => { 'id_provider' => 'local', } } $reconnection_retries = 3 $re_expression = '' $full_name_format = '' $try_inotify = '' $krb5_rcache_dir = '' $default_domain_suffix = '' $rotate_uris = false $nss_options = {} $pam_options = {} $sudo_options = {} $autofs_options = {} $ssh_options = {} $flush_cache_on_change = true } asciiduck-sssd-0.3.0/manifests/service.pp0000644006171200004550000000107312703530043020412 0ustar kkirklanepicadm# == Class: sssd::service # # This is an internal class. # The main entry point for the module is the init class # class sssd::service { if $sssd::manage_service { service{$sssd::service_name: ensure => $sssd::service_ensure, enable => $sssd::service_enable, } if $sssd::flush_cache_on_change { exec{'sss_cache flush': command => 'sss_cache -E', path => $sssd::sss_cache_path, refreshonly => true, returns => [0, 2], require => Service[$sssd::service_name] } } } } asciiduck-sssd-0.3.0/templates/0000755006171200004550000000000012642755617016437 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/templates/sssd.conf.erb0000644006171200004550000000361112642755617021032 0ustar kkirklanepicadm# This file is maintained by Puppet # Any changes will be lost [sssd] config_file_version = 2 <% if @reconnection_retries and @reconnection_retries != '' -%> reconnection_retries = <%= @reconnection_retries %> <% end -%> <% if @sbus_timeout and @sbus_timeout != '' -%> sbus_timeout = <%= @sbus_timeout %> <% end -%> services = <%= @services.join(',') %> domains = <%= @domains.keys().join(',') %> <% if @services.include?('nss') -%> [nss] <% @nss_options.sort.each do |key,value| -%> <% if value.kind_of?(Array) -%> <%= key -%> = <%= value.join(',') %> <% else -%> <%= key -%> = <%= value %> <% end -%> <% end -%> <% end -%> <% if @services.include?('pam') -%> [pam] <% @pam_options.sort.each do |key,value| -%> <% if value.kind_of?(Array) -%> <%= key -%> = <%= value.join(',') %> <% else -%> <%= key -%> = <%= value %> <% end -%> <% end -%> <% end -%> <% if @services.include?('sudo') -%> [sudo] <% @sudo_options.sort.each do |key,value| -%> <% if value.kind_of?(Array) -%> <%= key -%> = <%= value.join(',') %> <% else -%> <%= key -%> = <%= value %> <% end -%> <% end -%> <% end -%> <% if @services.include?('autofs') -%> [autofs] <% @autofs_options.sort.each do |key,value| -%> <% if value.kind_of?(Array) -%> <%= key -%> = <%= value.join(',') %> <% else -%> <%= key -%> = <%= value %> <% end -%> <% end -%> <% end -%> <% if @services.include?('ssh') -%> [ssh] <% @ssh_options.sort.each do |key,value| -%> <% if value.kind_of?(Array) -%> <%= key -%> = <%= value.join(',') %> <% else -%> <%= key -%> = <%= value %> <% end -%> <% end -%> <% end -%> <% @domains.sort.each do |name,data| -%> [domain/<%= name -%>] <% data.sort.each do |key,value| -%> <% if key =~ /_uri/ and @rotate_uris and value.kind_of?(Array) -%> <%= key -%> = <%= scope.function_fqdn_rotate([value]).join(',') %> <% elsif value.kind_of?(Array) -%> <%= key -%> = <%= value.join(',') %> <% else -%> <%= key -%> = <%= value %> <% end -%> <% end -%> <% end -%> asciiduck-sssd-0.3.0/checksums.json0000644006171200004550000000171312703530716017310 0ustar kkirklanepicadm{ "Gemfile": "4b813de2d669780ceabc44c103ba80de", "Gemfile.lock": "5a3e6d87be9b393e2d88f1fbc209b506", "README.md": "d942a8d9321a193316f3ccc296afbf6a", "Rakefile": "cce445856d8e86f0050dd878428e64ff", "manifests/config.pp": "037b61f196daa2f3850165c6ea2fe4fe", "manifests/init.pp": "aeec86b1206636a12787de2c3fc85188", "manifests/install.pp": "f9511a563e48ab8e36d35c7d6b9d9693", "manifests/params.pp": "ff2f702feee5383dfcbf5f59283d78fd", "manifests/service.pp": "847fad48f8f1ff96d3eec1ece7eea781", "metadata.json": "be796572518998ed3dcb0e12c52cd3a3", "spec/classes/sssd_spec.rb": "446133a3503f2ace5079f66e98fa0d57", "spec/spec_helper.rb": "0db89c9a486df193c0e40095422e19dc", "spec/test-resources/files/sssd.conf": "d41d8cd98f00b204e9800998ecf8427e", "spec/test-resources/templates/sssd.erb": "92004106c5e125d53f1a933852e5b68a", "templates/sssd.conf.erb": "42a5917e3714fd86861b13456ce932c5", "tests/init.pp": "ebcb522aa394800a80c3a9366e5658c0" }asciiduck-sssd-0.3.0/README.md0000644006171200004550000000223112642755617015716 0ustar kkirklanepicadm# sssd #### Table of Contents 1. [Overview](#overview) 2. [Module Description](#module-description) 3. [Usage - Configuration options and additional functionality](#usage) 4. [Development - Guide for contributing to the module](#development) ## Overview SSSD is the replacement for nslcd that is the default in CentOS and RHEL 7. ## Module Description This module will install, configure and manage the SSSD service, but it will not touch your nsswitch or your pam configs, that's the job for another module. Currently this module only supports RHEL/CentOS 7, Ubuntu 14.04, Debian 8.x; however, if you specify the needed parameters yourself you can override the "unsupported os" failure. Previously this module would install the sudo package on Debian based platforms which replaced the package sudo-ldap. It was decided that the decision of which sudo package to use was out of scope of this module. If you are seeing issues with sudo and sssd on Ubuntu 14.04 or Debian 8.x ensure you have sudo installed and not sudo-ldap. ## Usage Incoming ## Development If you would like to contribute, just go through the standard: * Fork * Feature branch * Pull Request asciiduck-sssd-0.3.0/spec/0000755006171200004550000000000012642755617015373 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/test-resources/0000755006171200004550000000000012642755617020362 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/test-resources/files/0000755006171200004550000000000012642755617021464 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/test-resources/files/sssd.conf0000644006171200004550000000000012642755617023275 0ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/test-resources/templates/0000755006171200004550000000000012642755617022360 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/test-resources/templates/sssd.erb0000644006171200004550000000001712642755617024024 0ustar kkirklanepicadmTest template. asciiduck-sssd-0.3.0/spec/classes/0000755006171200004550000000000012642761331017016 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/classes/sssd_spec.rb0000644006171200004550000003413212642761331021334 0ustar kkirklanepicadmrequire 'spec_helper' describe 'sssd' do ['Ubuntu1404'].each do |platform| context "on #{platform}" do defaults = Hash.new if platform.eql?('RHEL7') let(:facts) { { :osfamily => 'RedHat', :operatingsystem => 'RedHat', :operatingsystemmajrelease => '7', :operatingsystemrelease => '7.0', :kernel => 'Linux', :fqdn => 'test.example.org', } } defaults[:package_name] = ['sssd','sssd-ldap'] defaults[:package_ensure] = 'present' defaults[:config_path] = '/etc/sssd/sssd.conf' defaults[:config_owner] = 'root' defaults[:config_group] = 'root' defaults[:config_mode] = '0600' defaults[:service_name] = 'sssd' defaults[:service_ensure] = 'running' defaults[:service_enable] = true end if platform.eql?('Ubuntu1404') let(:facts) { { :osfamily => 'Debian', :operatingsystem => 'Ubuntu', :operatingsystemmajrelease => '14.04', :operatingsystemrelease => '14.04', :lsbdistrelease => '14.04', :kernel => 'Linux', :fqdn => 'test.example.org', } } defaults[:package_name] = ['sssd','sssd-ldap'] defaults[:package_ensure] = 'present' defaults[:config_path] = '/etc/sssd/sssd.conf' defaults[:config_owner] = 'root' defaults[:config_group] = 'root' defaults[:config_mode] = '0600' defaults[:service_name] = 'sssd' defaults[:service_ensure] = 'running' defaults[:service_enable] = true end describe 'with defaults for all parameters' do it do should compile should contain_class('sssd') should contain_class('sssd::install') should contain_class('sssd::config') should contain_class('sssd::service') if defaults[:package_name].kind_of?(Array) defaults[:package_name].each do |p| should contain_package(p).with_ensure(defaults[:package_ensure]) end else should contain_package(defaults[:package_name]).with_ensure(defaults[:package_ensure]) end should contain_service(defaults[:service_name]).with( { :ensure => defaults[:service_ensure], :enable => defaults[:service_enable], } ) should contain_file(defaults[:config_path]).with ( { :owner => defaults[:config_owner], :group => defaults[:config_group], :mode => defaults[:config_mode], :content => /This file is maintained by Puppet/ } ) end end ## Package overrides describe 'with package_name override' do ['package-string',['package','array']].each do |package_name| describe "equal #{package_name}" do let(:params) { { :package_name => package_name } } if package_name.kind_of?(Array) package_name.each do |p| it {should contain_package(p).with_ensure(defaults[:package_ensure])} end else it {should contain_package(package_name).with_ensure(defaults[:package_ensure])} end end end describe 'invalid' do let(:params) { { :package_name => {'name'=>'sssd-package'} } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with package_ensure override' do ['latest','absent','present','8.0'].each do |ensure_val| describe "equal #{ensure_val}" do let(:params) { { :package_ensure => ensure_val } } defaults[:package_name].each do |p| it {should contain_package(p).with_ensure(ensure_val)} end end end describe 'invalid' do let(:params) { { :package_ensure => ['invalid','array'] } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with manage_package override' do describe 'equal false' do let(:params) { { :manage_package => false } } it { should have_package_count(0) } end describe 'invalid' do let(:params) { { :manage_package => 'invalid' } } it { is_expected.to raise_error(Puppet::Error) } end end # Config overrides describe 'with config_path override' do describe 'equals /foo/sssd.conf' do let(:params) { { :config_path => '/foo/sssd.conf' } } it { should contain_file('/foo/sssd.conf').with ( { :owner => defaults[:config_owner], :group => defaults[:config_group], :mode => defaults[:config_mode], } ) } end describe 'equals foo/sssd.conf' do let(:params) { { :config_path => 'foo/sssd.conf' } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with config_owner override' do describe 'equals foo-owner' do let(:params) { { :config_owner => 'foo-owner' } } it { should contain_file(defaults[:config_path]).with ( { :owner => 'foo-owner', :group => defaults[:config_group], :mode => defaults[:config_mode], } ) } end describe 'equals an array ' do let(:params) { { :config_owner => ['foo','bar'] } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with config_group override' do describe 'equals foo-group' do let(:params) { { :config_group => 'foo-group' } } it { should contain_file(defaults[:config_path]).with ( { :owner => defaults[:config_owner], :group => 'foo-group', :mode => defaults[:config_mode], } ) } end describe 'equals an array ' do let(:params) { { :config_group => ['foo','bar'] } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with config_mode override' do ['777','0777'].each do |config_mode| describe "equals #{config_mode}" do let(:params) { { :config_mode => config_mode } } it { should contain_file(defaults[:config_path]).with ( { :owner => defaults[:config_owner], :group => defaults[:config_group], :mode => config_mode, } ) } end end describe 'equals an 890' do let(:params) { { :config_mode => '890' } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with config_content override' do describe "equals 'Test content'" do let(:params) { { :config_content => 'Test content' } } it { should contain_file(defaults[:config_path]).with ( { :owner => defaults[:config_owner], :group => defaults[:config_group], :mode => defaults[:config_mode], :content => 'Test content' } ) } end describe 'equals an array' do let(:params) { { :config_mode => ['one','two'] } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with config_source override' do describe "equals puppet:///test-resources/sssd.conf" do let(:params) { { :config_source => 'puppet:///test-resources/sssd.conf' } } it { should contain_file(defaults[:config_path]).with ( { :owner => defaults[:config_owner], :group => defaults[:config_group], :mode => defaults[:config_mode], :source => 'puppet:///test-resources/sssd.conf', } ) } end describe 'equals an array' do let(:params) { { :config_mode => ['one','two'] } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with config_template override' do describe "equals test-resources/sssd.erb" do let(:params) { { :config_template => 'test-resources/sssd.erb' } } it { should contain_file(defaults[:config_path]).with ( { :owner => defaults[:config_owner], :group => defaults[:config_group], :mode => defaults[:config_mode], :content => "Test template.\n" } ) } end describe 'equals an array' do let(:params) { { :config_mode => ['one','two'] } } it { is_expected.to raise_error(Puppet::Error) } end end # Service overrides describe 'with service_name override' do ['service-string',].each do |service_name| describe "equal #{service_name}" do let(:params) { { :service_name => service_name } } if service_name.kind_of?(Array) service_name.each do |p| it {should contain_service(p).with_ensure(defaults[:service_ensure])} end else it {should contain_service(service_name).with_ensure(defaults[:service_ensure])} end end end describe 'invalid' do let(:params) { { :service_name => ['sssd-service','other-service'] } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with service_ensure override' do ['running','stopped'].each do |ensure_val| describe "equal #{ensure_val}" do let(:params) { { :service_ensure => ensure_val } } it {should contain_service(defaults[:service_name]).with_ensure(ensure_val)} end end describe 'invalid' do let(:params) { { :service_ensure => 'waffles' } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with service_enable override' do [true,false].each do |enable_val| describe "equal #{enable_val}" do let(:params) { { :service_enable => enable_val } } it {should contain_service(defaults[:service_name]).with_enable(enable_val)} end end describe 'invalid' do let(:params) { { :service_enable => 'waffles' } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with manage_service override' do describe 'equal false' do let(:params) { { :manage_service => false } } it { should have_service_count(0) } end describe 'invalid' do let(:params) { { :manage_service => 'invalid' } } it { is_expected.to raise_error(Puppet::Error) } end end describe 'with flush_cache_on_change override' do describe "equal false" do let(:params) { { :flush_cache_on_change => false } } it {should_not contain_exec('sss_cache flush')} end describe "equal true" do let(:params) { { :flush_cache_on_change => true } } it {should contain_exec('sss_cache flush').with_command('sss_cache -E')} end end # application setting overrides describe 'with domain settings overrode:' do describe 'ldap domain without uri rotation' do let(:params) { { :domains => { 'example' => { 'id_provider' => 'ldap', 'ldap_uri' => ['ldap://ldap1.example.org','ldap://ldap2.example.org'], } } } } it do should contain_file(defaults[:config_path]).with_content(/ldap_uri = ldap:\/\/ldap1\.example\.org,ldap:\/\/ldap2\.example\.org/) end end describe 'ldap domain with uri rotation' do let(:params) { { :domains => { 'example' => { 'id_provider' => 'ldap', 'ldap_uri' => ['ldap://ldap1.example.org','ldap://ldap2.example.org'], } }, :rotate_uris => true } } it do should contain_file(defaults[:config_path]).with_content(/ldap_uri = (?=.*ldap1\.example\.org)(?=.*ldap2\.example\.org)/) end end end end end context "on unsupported platform" do let(:facts) { { :osfamily => 'Windows', :operatingsystem => 'Windows', :operatingsystemmajrelease => '3', :operatingsystemrelease => '3.1', :kernel => 'Microsfot', :fqdn => 'test.example.org', } } describe 'with defaults for all parameters' do it { is_expected.to raise_error(Puppet::Error, /unsupported os/i) } end describe 'with override_unsupported = true and values provided for everything' do let(:params) { { :override_unsupported => true, :manage_package => true, :package_name => 'foo', :package_ensure => 'present', :manage_config => true, :config_path => '/foo.conf', :config_owner => 'foo', :config_group => 'foo', :config_mode => '1234', :manage_service => true, :service_name => 'foo', :service_ensure => 'running', :service_enable => true, :sss_cache_path => ['/foo/'] } } it { should compile } end end end asciiduck-sssd-0.3.0/spec/spec_helper.rb0000644006171200004550000000006412642755617020211 0ustar kkirklanepicadmrequire 'puppetlabs_spec_helper/module_spec_helper' asciiduck-sssd-0.3.0/spec/fixtures/0000755006171200004550000000000012642757067017245 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/fixtures/modules/0000755006171200004550000000000012703530316020675 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/fixtures/manifests/0000755006171200004550000000000012703530316021216 5ustar kkirklanepicadmasciiduck-sssd-0.3.0/spec/fixtures/.gitkeep0000644006171200004550000000000012642755617020663 0ustar kkirklanepicadmasciiduck-sssd-0.3.0/metadata.json0000644006171200004550000000132512703530716017102 0ustar kkirklanepicadm{ "name": "asciiduck-sssd", "version": "0.3.0", "author": "asciiduck", "summary": "Manage the SSSD service.", "license": "Apache 2.0", "source": "https://github.com/ASCIIDuck/asciiduck-sssd", "project_page": "https://github.com/ASCIIDuck/asciiduck-sssd", "issues_url": "https://github.com/ASCIIDuck/asciiduck-sssd/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "7.0" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", "15.10", "16.04" ] } ], "dependencies": [ { "name": "puppetlabs-stdlib", "version_range": ">= 1.0.0" } ] }