main.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. - name: Check for NetworkManager service
  3. command: >
  4. systemctl show NetworkManager
  5. register: nm_show
  6. changed_when: false
  7. - name: Set fact using_network_manager
  8. set_fact:
  9. network_manager_active: "{{ True if 'ActiveState=active' in nm_show.stdout else False }}"
  10. - name: Install dnsmasq
  11. action: "{{ ansible_pkg_mgr }} name=dnsmasq state=installed"
  12. when: not openshift.common.is_atomic | bool
  13. - name: Install dnsmasq configuration
  14. template:
  15. src: origin-dns.conf.j2
  16. dest: /etc/dnsmasq.d/origin-dns.conf
  17. - name: Deploy additional dnsmasq.conf
  18. template:
  19. src: "{{ openshift_node_dnsmasq_additional_config_file }}"
  20. dest: /etc/dnsmasq.d/openshift-ansible.conf
  21. owner: root
  22. group: root
  23. mode: 0644
  24. when: openshift_node_dnsmasq_additional_config_file is defined
  25. notify: restart dnsmasq
  26. # Dynamic NetworkManager based dispatcher
  27. - include: ./network-manager.yml
  28. when: network_manager_active | bool
  29. # Relies on ansible in order to configure static config
  30. - include: ./no-network-manager.yml
  31. when: not network_manager_active | bool