network_manager.yml 665 B

12345678910111213141516171819202122232425262728
  1. ---
  2. - name: Install and configure NetworkManager
  3. hosts: oo_all_hosts
  4. become: yes
  5. tasks:
  6. - name: install NetworkManager
  7. package:
  8. name: 'NetworkManager'
  9. state: present
  10. register: result
  11. until: result is succeeded
  12. - name: configure NetworkManager
  13. lineinfile:
  14. dest: "/etc/sysconfig/network-scripts/ifcfg-{{ ansible_default_ipv4['interface'] }}"
  15. regexp: '^{{ item }}='
  16. line: '{{ item }}=yes'
  17. state: present
  18. create: yes
  19. with_items:
  20. - 'USE_PEERDNS'
  21. - 'NM_CONTROLLED'
  22. - name: enable and start NetworkManager
  23. service:
  24. name: 'NetworkManager'
  25. state: started
  26. enabled: yes