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.

33 lines
1012 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. path: "{{ dhclientconffile }}"
  9. create: yes
  10. state: present
  11. insertbefore: BOF
  12. backup: yes
  13. marker: "# Ansible entries {mark}"
  14. notify: Preinstall | propagate resolvconf to k8s components
  15. when: dhclientconffile is defined
  16. - name: Configure dhclient hooks for resolv.conf (non-RH)
  17. template:
  18. src: dhclient_dnsupdate.sh.j2
  19. dest: "{{ dhclienthookfile }}"
  20. owner: root
  21. mode: 0755
  22. notify: Preinstall | propagate resolvconf to k8s components
  23. when: ansible_os_family != "RedHat"
  24. - name: Configure dhclient hooks for resolv.conf (RH-only)
  25. template:
  26. src: dhclient_dnsupdate_rh.sh.j2
  27. dest: "{{ dhclienthookfile }}"
  28. owner: root
  29. mode: 0755
  30. notify: Preinstall | propagate resolvconf to k8s components
  31. when: ansible_os_family == "RedHat"