Add vm_guest additions role
This commit is contained in:
parent
bdb914b03b
commit
2d0c10aa35
4
roles/vm_guest/defaults/main.yaml
Normal file
4
roles/vm_guest/defaults/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
vm_guest_agent_package_state: present
|
||||
vm_guest_agent_service_state: started
|
||||
vm_guest_agent_service_enabled: yes
|
11
roles/vm_guest/tasks/kvm.yaml
Normal file
11
roles/vm_guest/tasks/kvm.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: install SPICE agent
|
||||
package:
|
||||
name: "{{ vm_guest_spice_agent_package_name }}"
|
||||
state: "{{ vm_guest_spice_agent_package_state }}"
|
||||
|
||||
- name: start SPICE agent
|
||||
service:
|
||||
name: "{{ vm_guest_spice_agent_service_name }}"
|
||||
state: "{{ vm_guest_spice_agent_service_state }}"
|
||||
enabled: "{{ vm_guest_spice_agent_service_enabled }}"
|
28
roles/vm_guest/tasks/main.yaml
Normal file
28
roles/vm_guest/tasks/main.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: gather OS specific variables
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
|
||||
- name: gather virtualization specific variables
|
||||
include_vars: "{{ item }}"
|
||||
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:
|
||||
"{{ ansible_virtualization_type }}.yaml"
|
1
roles/vm_guest/vars/Debian.yaml
Normal file
1
roles/vm_guest/vars/Debian.yaml
Normal file
@ -0,0 +1 @@
|
||||
---
|
10
roles/vm_guest/vars/kvm.yaml
Normal file
10
roles/vm_guest/vars/kvm.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
vm_guest_agent_package_name: qemu-guest-agent
|
||||
vm_guest_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
|
Loading…
Reference in New Issue
Block a user