Saltstack Official Chrony Formula
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- # frozen_string_literal: true
-
- # Overide by OS
- keyfile = 'keyfile '
- driftfile = '/var/lib/chrony/'
- logdir = 'logdir /var/log/chrony'
- case platform[:name]
- when 'debian', 'ubuntu'
- config_file = '/etc/chrony/chrony.conf'
- keyfile += '/etc/chrony/chrony.keys'
- driftfile += 'chrony.drift'
- when 'gentoo'
- config_file = '/etc/chrony/chrony.conf'
- keyfile += '/etc/chrony.keys'
- driftfile += 'drift'
- else
- config_file = '/etc/chrony.conf'
- keyfile += '/etc/chrony.keys'
- driftfile += 'drift'
- end
-
- control 'Chrony configuration' do
- title 'should match desired lines'
-
- describe file(config_file) do
- it { should be_file }
- it { should be_owned_by 'root' }
- it { should be_grouped_into 'root' }
- its('mode') { should cmp '0644' }
- its('content') { should include keyfile }
- its('content') { should include driftfile }
- its('content') { should include logdir }
- end
- end
|