|
160 | 160 | end
|
161 | 161 | end
|
162 | 162 | end
|
163 |
| - |
164 | 163 | context 'on RedHat operatingsystems' do
|
165 | 164 | let(:facts) do
|
166 | 165 | {
|
|
320 | 319 | end
|
321 | 320 | end
|
322 | 321 | end
|
| 322 | + |
| 323 | + describe 'Ordering' do |
| 324 | + let(:facts) do |
| 325 | + { |
| 326 | + :osfamily => 'RedHat', |
| 327 | + :operatingsystem => 'RedHat', |
| 328 | + :kernel => 'Linux' |
| 329 | + } |
| 330 | + end |
| 331 | + context 'with ordering set' do |
| 332 | + let(:params) do |
| 333 | + { |
| 334 | + :puppet_server => 'test.exaple.com', |
| 335 | + :puppet_agent_service => 'puppet', |
| 336 | + :puppet_agent_package => 'puppet', |
| 337 | + :version => '/etc/puppet/manifests/site.pp', |
| 338 | + :puppet_run_style => 'cron', |
| 339 | + :splay => 'true', |
| 340 | + :environment => 'production', |
| 341 | + :ordering => 'manifest', |
| 342 | + :puppet_run_interval => 30, |
| 343 | + :puppet_server_port => 8140, |
| 344 | + :use_srv_records => false, |
| 345 | + } |
| 346 | + end |
| 347 | + |
| 348 | + it{ |
| 349 | + should contain_ini_setting('puppetagentordering').with( |
| 350 | + :ensure => 'present', |
| 351 | + :section => 'agent', |
| 352 | + :setting => 'ordering', |
| 353 | + :value => 'manifest', |
| 354 | + :path => '/etc/puppet/puppet.conf' |
| 355 | + ) |
| 356 | + } |
| 357 | + end |
| 358 | + |
| 359 | + context 'with ordering not set' do |
| 360 | + let(:params) do |
| 361 | + { |
| 362 | + :puppet_server => 'test.exaple.com', |
| 363 | + :puppet_agent_service => 'puppet', |
| 364 | + :puppet_agent_package => 'puppet', |
| 365 | + :version => '/etc/puppet/manifests/site.pp', |
| 366 | + :puppet_run_style => 'cron', |
| 367 | + :splay => 'true', |
| 368 | + :environment => 'production', |
| 369 | + :puppet_run_interval => 30, |
| 370 | + :puppet_server_port => 8140, |
| 371 | + :use_srv_records => false, |
| 372 | + } |
| 373 | + end |
| 374 | + |
| 375 | + it{ |
| 376 | + should contain_ini_setting('puppetagentordering').with( |
| 377 | + :ensure => 'absent', |
| 378 | + :section => 'agent', |
| 379 | + :setting => 'ordering', |
| 380 | + :path => '/etc/puppet/puppet.conf' |
| 381 | + ) |
| 382 | + } |
| 383 | + end |
| 384 | + end |
| 385 | + describe 'Trusted fact' do |
| 386 | + let(:facts) do |
| 387 | + { |
| 388 | + :osfamily => 'RedHat', |
| 389 | + :operatingsystem => 'RedHat', |
| 390 | + :kernel => 'Linux' |
| 391 | + } |
| 392 | + end |
| 393 | + context 'with trusted set' do |
| 394 | + let(:params) do |
| 395 | + { |
| 396 | + :puppet_server => 'test.exaple.com', |
| 397 | + :puppet_agent_service => 'puppet', |
| 398 | + :puppet_agent_package => 'puppet', |
| 399 | + :version => '/etc/puppet/manifests/site.pp', |
| 400 | + :puppet_run_style => 'cron', |
| 401 | + :splay => 'true', |
| 402 | + :environment => 'production', |
| 403 | + :trusted_node_data => 'true', |
| 404 | + :puppet_run_interval => 30, |
| 405 | + :puppet_server_port => 8140, |
| 406 | + :use_srv_records => false, |
| 407 | + } |
| 408 | + end |
| 409 | + |
| 410 | + it{ |
| 411 | + should contain_ini_setting('puppetagenttrusted_node_data').with( |
| 412 | + :ensure => 'present', |
| 413 | + :section => 'agent', |
| 414 | + :setting => 'trusted_node_data', |
| 415 | + :value => 'true', |
| 416 | + :path => '/etc/puppet/puppet.conf' |
| 417 | + ) |
| 418 | + } |
| 419 | + end |
| 420 | + |
| 421 | + context 'with trusted not set' do |
| 422 | + let(:params) do |
| 423 | + { |
| 424 | + :puppet_server => 'test.exaple.com', |
| 425 | + :puppet_agent_service => 'puppet', |
| 426 | + :puppet_agent_package => 'puppet', |
| 427 | + :version => '/etc/puppet/manifests/site.pp', |
| 428 | + :puppet_run_style => 'cron', |
| 429 | + :splay => 'true', |
| 430 | + :environment => 'production', |
| 431 | + :puppet_run_interval => 30, |
| 432 | + :puppet_server_port => 8140, |
| 433 | + :use_srv_records => false, |
| 434 | + } |
| 435 | + end |
| 436 | + |
| 437 | + it{ |
| 438 | + should contain_ini_setting('puppetagenttrusted_node_data').with( |
| 439 | + :ensure => 'absent', |
| 440 | + :section => 'agent', |
| 441 | + :setting => 'trusted_node_data', |
| 442 | + :path => '/etc/puppet/puppet.conf' |
| 443 | + ) |
| 444 | + } |
| 445 | + end |
| 446 | + end |
323 | 447 | end
|
0 commit comments