main.yml 774 B

123456789101112131415161718192021222324252627
  1. ---
  2. - name: Check for NetworkManager service
  3. command: >
  4. systemctl show NetworkManager
  5. register: nm_show
  6. - name: Set fact using_network_manager
  7. set_fact:
  8. network_manager_active: "{{ True if 'ActiveState=active' in nm_show.stdout else False }}"
  9. - name: Install dnsmasq
  10. action: "{{ ansible_pkg_mgr }} name=dnsmasq state=installed"
  11. when: not openshift.common.is_atomic | bool
  12. - name: Install dnsmasq configuration
  13. template:
  14. src: origin-dns.conf.j2
  15. dest: /etc/dnsmasq.d/origin-dns.conf
  16. # Dynamic NetworkManager based dispatcher
  17. - include: ./network-manager.yml
  18. when: network_manager_active | bool
  19. # Relies on ansible in order to configure static config
  20. - include: ./no-network-manager.yml
  21. when: not network_manager_active | bool