network_manager.yml 819 B

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