common: use ansible facts to detect KVM VMs

This commit is contained in:
Markus 2018-05-02 12:11:31 +02:00
parent d3a50a75d6
commit cc5611ca37
3 changed files with 2 additions and 6 deletions

View File

@ -64,5 +64,3 @@ racktables_dbpass: chee6iechuz1EghuheiD
snmp_allowed: snmp_allowed:
- 172.23.2.5 - 172.23.2.5
- 172.23.2.6 - 172.23.2.6
virtual_machine: true

View File

@ -10,5 +10,3 @@ ntp_peers:
slapd_hostname: ldap1.binary.kitchen slapd_hostname: ldap1.binary.kitchen
slapd_role: slave slapd_role: slave
virtual_machine: false

View File

@ -35,9 +35,9 @@
- vim-nox - vim-nox
- zsh - zsh
- name: Install qemu-agent on VMs - name: Install qemu-agent on KVM VMs
apt: name=qemu-guest-agent apt: name=qemu-guest-agent
when: virtual_machine == true when: ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm"
- name: Configure misc software - name: Configure misc software
copy: src={{ item.src }} dest={{ item.dest }} copy: src={{ item.src }} dest={{ item.dest }}