diff --git a/roles/vm_guest/defaults/main.yaml b/roles/vm_guest/defaults/main.yaml index b0fa5c3..9149e65 100644 --- a/roles/vm_guest/defaults/main.yaml +++ b/roles/vm_guest/defaults/main.yaml @@ -1,4 +1,8 @@ --- -vm_guest_agent_package_state: present -vm_guest_agent_service_state: started -vm_guest_agent_service_enabled: yes +vm_guest_qemu_agent_package_state: present +vm_guest_qemu_agent_service_state: started +vm_guest_qemu_agent_service_enabled: yes + +vm_guest_spice_agent_package_state: present +vm_guest_spice_agent_service_state: started +vm_guest_spice_agent_service_enabled: yes diff --git a/roles/vm_guest/tasks/kvm.yaml b/roles/vm_guest/tasks/kvm.yaml index cfcff26..e5bd6d3 100644 --- a/roles/vm_guest/tasks/kvm.yaml +++ b/roles/vm_guest/tasks/kvm.yaml @@ -1,4 +1,15 @@ --- +- name: install guest agent + package: + name: "{{ vm_guest_qemu_agent_package_name }}" + state: "{{ vm_guest_qemu_agent_package_state }}" + +- name: start guest agent + service: + name: "{{ vm_guest_qemu_agent_service_name }}" + state: "{{ vm_guest_qemu_agent_service_state }}" + enabled: "{{ vm_guest_qemu_agent_service_enabled }}" + - name: install SPICE agent package: name: "{{ vm_guest_spice_agent_package_name }}" diff --git a/roles/vm_guest/tasks/main.yaml b/roles/vm_guest/tasks/main.yaml index 5e8b7db..c54fdae 100644 --- a/roles/vm_guest/tasks/main.yaml +++ b/roles/vm_guest/tasks/main.yaml @@ -11,17 +11,6 @@ with_first_found: "{{ ansible_virtualization_type }}.yaml" -- name: install guest agent - package: - name: "{{ vm_guest_agent_package_name }}" - state: "{{ vm_guest_agent_package_state }}" - -- name: start guest agent - service: - name: "{{ vm_guest_agent_service_name }}" - state: "{{ vm_guest_agent_service_state }}" - enabled: "{{ vm_guest_agent_service_enabled }}" - - name: run virtualization specific tasks include: "{{ item }}" with_first_found: diff --git a/roles/vm_guest/vars/kvm.yaml b/roles/vm_guest/vars/kvm.yaml index bd46b3b..0ed15bf 100644 --- a/roles/vm_guest/vars/kvm.yaml +++ b/roles/vm_guest/vars/kvm.yaml @@ -1,10 +1,6 @@ --- -vm_guest_agent_package_name: qemu-guest-agent -vm_guest_agent_service_name: qemu-guest-agent +vm_guest_qemu_agent_package_name: qemu-guest-agent +vm_guest_qemu_agent_service_name: qemu-guest-agent vm_guest_spice_agent_package_name: spice-vdagent vm_guest_spice_agent_service_name: spice-vdagent - -vm_guest_spice_agent_package_state: present -vm_guest_spice_agent_service_state: started -vm_guest_spice_agent_service_enabled: yes