Saltstack Official Linux 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.

32 rindas
660B

  1. {%- from "linux/map.jinja" import network with context %}
  2. {%- if network.enabled %}
  3. {%- if grains.os_family in ['Arch', 'Debian'] %}
  4. linux_hostname_file:
  5. file.managed:
  6. - name: {{ network.hostname_file }}
  7. - source: salt://linux/files/hostname
  8. - template: jinja
  9. - user: root
  10. - group: root
  11. - mode: 644
  12. - watch_in:
  13. - cmd: linux_enforce_hostname
  14. {%- endif %}
  15. linux_enforce_hostname:
  16. cmd.wait:
  17. - name: hostname {{ network.hostname }}
  18. {#
  19. linux_hostname_hosts:
  20. host.present:
  21. - ip: {{ grains.ip4_interfaces[network.get('default_interface', 'eth0')][0] }}
  22. - names:
  23. - {{ network.fqdn }}
  24. - {{ network.hostname }}
  25. #}
  26. {%- endif %}