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.

37 lines
964B

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {#- Get the `tplroot` from `tpldir` #}
  4. {%- set tplroot = tpldir.split('/')[0] %}
  5. {%- set sls_package_install = tplroot ~ '.package.install' %}
  6. {%- from tplroot ~ "/map.jinja" import chrony with context %}
  7. {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
  8. include:
  9. - {{ sls_package_install }}
  10. {%- if chrony.confd is string %}
  11. chrony-config-conf.d:
  12. file.directory:
  13. - name: {{ chrony.confd }}
  14. - clean: True
  15. - require:
  16. - sls: {{ sls_package_install }}
  17. {%- endif %}
  18. chrony-config-file-file-managed:
  19. file.managed:
  20. - name: {{ chrony.config }}
  21. - source: {{ files_switch(['chrony.conf.jinja'],
  22. lookup='chrony-config-file-file-managed'
  23. )
  24. }}
  25. - mode: 644
  26. - user: root
  27. - group: root
  28. - template: jinja
  29. - context:
  30. chrony: {{ chrony|json }}
  31. - require:
  32. - sls: {{ sls_package_install }}