Saltstack Official Chrony Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930
  1. # frozen_string_literal: true
  2. # Overide by OS
  3. keyfile = 'keyfile '
  4. driftfile = '/var/lib/chrony/'
  5. logdir = 'logdir /var/log/chrony'
  6. case os[:name]
  7. when 'debian', 'ubuntu'
  8. config_file = '/etc/chrony/chrony.conf'
  9. keyfile += '/etc/chrony/chrony.keys'
  10. driftfile += 'chrony.drift'
  11. else
  12. config_file = '/etc/chrony.conf'
  13. keyfile += '/etc/chrony.keys'
  14. driftfile += 'drift'
  15. end
  16. control 'Chrony configuration' do
  17. title 'should match desired lines'
  18. describe file(config_file) do
  19. it { should be_file }
  20. it { should be_owned_by 'root' }
  21. it { should be_grouped_into 'root' }
  22. its('mode') { should cmp '0644' }
  23. its('content') { should include keyfile }
  24. its('content') { should include driftfile }
  25. its('content') { should include logdir }
  26. end
  27. end