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.

map.jinja 2.4KB

9 jaren geleden
9 jaren geleden
9 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {% set chrony = salt['grains.filter_by']({
  2. 'Debian': {
  3. 'package': 'chrony',
  4. 'service': 'chrony',
  5. 'config': '/etc/chrony/chrony.conf',
  6. 'config_src': 'salt://chrony/files/chrony_config',
  7. 'ntpservers': [
  8. '0.debian.pool.ntp.org',
  9. '1.debian.pool.ntp.org',
  10. '2.debian.pool.ntp.org',
  11. '3.debian.pool.ntp.org'
  12. ],
  13. 'options': 'offline minpoll 8',
  14. 'allow': [
  15. '10/8',
  16. '192.168/16',
  17. '172.16/12'
  18. ],
  19. 'logdir': '/var/log/chrony',
  20. 'keyfile': '/etc/chrony/chrony.keys',
  21. 'driftfile': '/var/lib/chrony/chrony.drift',
  22. 'otherparams': [
  23. 'log tracking measurements statistics',
  24. 'maxupdateskew 100.0',
  25. 'dumponexit',
  26. 'dumpdir /var/lib/chrony',
  27. 'commandkey 1',
  28. 'local stratum 10',
  29. 'rtconutc'
  30. ],
  31. },
  32. 'RedHat': {
  33. 'package': 'chrony',
  34. 'service': 'chronyd',
  35. 'config': '/etc/chrony.conf',
  36. 'config_src': 'salt://chrony/files/chrony_config',
  37. 'ntpservers': [
  38. '0.centos.pool.ntp.org',
  39. '1.centos.pool.ntp.org',
  40. '2.centos.pool.ntp.org',
  41. '3.centos.pool.ntp.org'
  42. ],
  43. 'options': 'iburst',
  44. 'logdir': '/var/log/chrony',
  45. 'keyfile': '/etc/chrony.keys',
  46. 'driftfile': '/var/lib/chrony/drift',
  47. 'otherparams': [
  48. 'rtcsync',
  49. 'makestep 10 3',
  50. 'stratumweight 0',
  51. 'bindcmdaddress 127.0.0.1',
  52. 'bindcmdaddress ::1',
  53. 'commandkey 1',
  54. 'generatecommandkey',
  55. 'noclientlog',
  56. 'logchange 0.5',
  57. ],
  58. },
  59. },
  60. grain='os_family',
  61. merge=salt['pillar.get']('chrony:config'))
  62. %}
  63. {# Debian distros check /etc/default/rcS to determine UTC setting #}
  64. {% if grains['os_family'] == "Debian" %}
  65. {% if salt['cmd.run']('grep UTC=no /etc/default/rcS') %}
  66. {% do chrony['otherparams'].remove('rtconutc') %}
  67. {% endif %}
  68. {% endif %}