diff --git a/handlers/main.yml b/handlers/main.yml index 464763f..f90318b 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -13,5 +13,5 @@ - name: bridge_enable become: yes - shell: netctl enable bridge && systemctl disable dhcpcd + shell: netctl enable bridge diff --git a/tasks/main.yml b/tasks/main.yml index 0ff8f41..90136a1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,7 +15,7 @@ - name: Add user to libvirt group user: - name: '{{ username }}' + name: '{{ user.name }}' groups: libvirt append: True become: yes @@ -35,6 +35,13 @@ template: dest: /etc/netctl/bridge # required. Location to render the template to on the remote machine. src: bridge.j2 # required. Path of a Jinja2 formatted template on the Ansible controller. This can be a relative or absolute path. - when: ansible_default_ipv4.type == "ether" + when: ansible_default_ipv4.type == "ether" and "wlp2s0" not in ansible_interfaces become: yes - notify: bridge_enable \ No newline at end of file + notify: bridge_enable + +- name: disable dhcpcd + systemd: + name: dhcpcd # required. Name of the service. + enabled: false + become: yes + \ No newline at end of file