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.

34 lines
955 B

  1. ---
  2. - name: Configure dhclient to supersede search/domain/nameservers
  3. blockinfile:
  4. block: |-
  5. {% for item in [ supersede_domain, supersede_search, supersede_nameserver ] -%}
  6. {{ item }}
  7. {% endfor %}
  8. dest: "{{dhclientconffile}}"
  9. create: yes
  10. state: present
  11. insertbefore: BOF
  12. backup: yes
  13. follow: yes
  14. marker: "# Ansible entries {mark}"
  15. notify: Preinstall | restart network
  16. when: dhclientconffile is defined
  17. - name: Configue dhclient hooks for resolv.conf (non-RH)
  18. template:
  19. src: dhclient_dnsupdate.sh.j2
  20. dest: "{{ dhclienthookfile }}"
  21. owner: root
  22. mode: 0755
  23. notify: Preinstall | restart network
  24. when: ansible_os_family != "RedHat"
  25. - name: Configue dhclient hooks for resolv.conf (RH-only)
  26. template:
  27. src: dhclient_dnsupdate_rh.sh.j2
  28. dest: "{{ dhclienthookfile }}"
  29. owner: root
  30. mode: 0755
  31. notify: Preinstall | restart network
  32. when: ansible_os_family == "RedHat"