network_manager.yml 664 B

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