|
444 | 444 | }
|
445 | 445 | end
|
446 | 446 | end
|
| 447 | + describe 'Trusted fact' do |
| 448 | + let(:facts) do |
| 449 | + { |
| 450 | + :osfamily => 'RedHat', |
| 451 | + :operatingsystem => 'RedHat', |
| 452 | + :kernel => 'Linux' |
| 453 | + } |
| 454 | + end |
| 455 | + context 'with templatedir set' do |
| 456 | + let(:params) do |
| 457 | + { |
| 458 | + :puppet_server => 'test.exaple.com', |
| 459 | + :puppet_agent_service => 'puppet', |
| 460 | + :puppet_agent_package => 'puppet', |
| 461 | + :version => '/etc/puppet/manifests/site.pp', |
| 462 | + :puppet_run_style => 'cron', |
| 463 | + :splay => 'true', |
| 464 | + :environment => 'production', |
| 465 | + :puppet_run_interval => 30, |
| 466 | + :puppet_server_port => 8140, |
| 467 | + :use_srv_records => false, |
| 468 | + } |
| 469 | + end |
| 470 | + |
| 471 | + it{ |
| 472 | + should contain_ini_setting('puppetagenttemplatedir').with( |
| 473 | + :ensure => 'present', |
| 474 | + :section => 'main', |
| 475 | + :setting => 'templatedir', |
| 476 | + :value => '$confdir/templates', |
| 477 | + :path => '/etc/puppet/puppet.conf' |
| 478 | + ) |
| 479 | + } |
| 480 | + end |
| 481 | + |
| 482 | + context 'with templatedir not set' do |
| 483 | + let(:params) do |
| 484 | + { |
| 485 | + :puppet_server => 'test.exaple.com', |
| 486 | + :puppet_agent_service => 'puppet', |
| 487 | + :puppet_agent_package => 'puppet', |
| 488 | + :version => '/etc/puppet/manifests/site.pp', |
| 489 | + :puppet_run_style => 'cron', |
| 490 | + :splay => 'true', |
| 491 | + :environment => 'production', |
| 492 | + :puppet_run_interval => 30, |
| 493 | + :puppet_server_port => 8140, |
| 494 | + :use_srv_records => false, |
| 495 | + :templatedir => 'undef' |
| 496 | + } |
| 497 | + end |
| 498 | + |
| 499 | + it{ |
| 500 | + should contain_ini_setting('puppetagenttemplatedir').with( |
| 501 | + :ensure => 'absent', |
| 502 | + :section => 'main', |
| 503 | + :setting => 'templatedir', |
| 504 | + :path => '/etc/puppet/puppet.conf' |
| 505 | + ) |
| 506 | + } |
| 507 | + end |
| 508 | + end |
447 | 509 | end
|
0 commit comments