From d07e73ac4c6f7e2001b5a5607d3d29a96f8687f3 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sun, 27 Oct 2019 18:38:13 -0500 Subject: [PATCH] Use KVM/Spice agent when applicable --- roles/vm_guest/defaults/main.yaml | 10 +++++++--- roles/vm_guest/tasks/kvm.yaml | 11 +++++++++++ roles/vm_guest/tasks/main.yaml | 11 ----------- roles/vm_guest/vars/kvm.yaml | 8 ++------ 4 files changed, 20 insertions(+), 20 deletions(-) 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