voxpupuli / puppet-chrony

Puppet module for Chrony with Systemd
https://forge.puppet.com/puppet/chrony
Apache License 2.0
13 stars 59 forks source link

Cannot configure refclocks #189

Open bmagistro opened 10 months ago

bmagistro commented 10 months ago

How to reproduce (e.g Puppet code you use)

This should be reproducibe with the example in the init.pp file as well for refclock

class { 'chrony':
  refclock => { 'sock' => ['/run/chrony.ttyAMA0.sock refid GPS precision 1e-1', '/run/chrony.pps0.sock refid PPS precision 1e-7'] }
}

What are you seeing

refclocks expects an array value, got a struct

What behaviour did you expect instead

a properly formed chrony.conf with two hardware refclocks configured


when updating init.pp to be a hash to accept the above line, it then concatenates both hardware clocks into a single line which is an error in the chrony config. this should be two lines. the template needs another layer of looping to generate this.


with some luck will be able to provide a pr for this later this week/next week

pavlinpetkov commented 3 months ago

Have the same issue. Current workaround for me is to configure it with nested arrays:

    class { 'chrony':
      refclocks => [['PHC', '/dev/ptp0', 'poll', '3', 'dpoll', '-2', 'offset', '0', 'stratum', '2']]
    }