main.yml 483 B

12345678910111213141516171819202122
  1. ---
  2. - name: install NetworkManager
  3. package:
  4. name: NetworkManager
  5. state: present
  6. - name: configure NetworkManager
  7. lineinfile:
  8. dest: "/etc/sysconfig/network-scripts/ifcfg-{{ ansible_default_ipv4['interface'] }}"
  9. regexp: '^{{ item }}='
  10. line: '{{ item }}=yes'
  11. state: present
  12. create: yes
  13. with_items:
  14. - 'USE_PEERDNS'
  15. - 'NM_CONTROLLED'
  16. - name: enable and start NetworkManager
  17. service:
  18. name: NetworkManager
  19. state: restarted
  20. enabled: yes