network_manager.yml 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ---
  2. - name: Create initial host groups for localhost
  3. hosts: localhost
  4. connection: local
  5. become: no
  6. gather_facts: no
  7. tags:
  8. - always
  9. tasks:
  10. - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
  11. - name: Evaluate group l_oo_all_hosts
  12. add_host:
  13. name: "{{ item }}"
  14. groups: l_oo_all_hosts
  15. with_items: "{{ g_all_hosts | default([]) }}"
  16. changed_when: False
  17. - name: Install and configure NetworkManager
  18. hosts: l_oo_all_hosts
  19. become: yes
  20. tasks:
  21. - name: install NetworkManager
  22. package:
  23. name: 'NetworkManager'
  24. state: present
  25. - name: configure NetworkManager
  26. lineinfile:
  27. dest: "/etc/sysconfig/network-scripts/ifcfg-{{ ansible_default_ipv4['interface'] }}"
  28. regexp: '^{{ item }}='
  29. line: '{{ item }}=yes'
  30. state: present
  31. create: yes
  32. with_items:
  33. - 'USE_PEERDNS'
  34. - 'NM_CONTROLLED'
  35. - name: enable and start NetworkManager
  36. service:
  37. name: 'NetworkManager'
  38. state: started
  39. enabled: yes