ansible/roles/vm_guest/tasks/main.yaml

29 lines
842 B
YAML

---
- 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"