Move virthost from a task to a role.
Setup a variable for hosts we want nested virt enabled on (default false) add task to setup that on ones we want
This commit is contained in:
parent
4f0c441afc
commit
aebe90cc65
6 changed files with 15 additions and 1 deletions
|
@ -3,6 +3,9 @@ freezes: true
|
|||
# most of our systems are in phx2
|
||||
datacenter: phx2
|
||||
|
||||
# usually we do not want to enable nested virt, only on some virthosts
|
||||
nested: false
|
||||
|
||||
# most of our systems are 64bit.
|
||||
# Used to install various nagios scripts and the like.
|
||||
libdir: /usr/lib64
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
# This virthost only has non release critical instances, so it doesn't freeze
|
||||
freezes: false
|
||||
nested: true
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
# This virthost only has non release critical instances, so it doesn't freeze
|
||||
freezes: false
|
||||
nested: true
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
- { role: iscsi_client, when: datacenter == "phx2" }
|
||||
- sudo
|
||||
- { role: openvpn/client, when: datacenter != "phx2" }
|
||||
- virthost
|
||||
|
||||
tasks:
|
||||
- include: "{{ tasks }}/yumrepos.yml"
|
||||
- include: "{{ tasks }}/2fa_client.yml"
|
||||
- include: "{{ tasks }}/motd.yml"
|
||||
- include: "{{ tasks }}/virthost.yml"
|
||||
|
||||
handlers:
|
||||
- include: "{{ handlers }}/restart_services.yml"
|
||||
|
|
1
roles/virthost/files/kvm_intel.conf
Normal file
1
roles/virthost/files/kvm_intel.conf
Normal file
|
@ -0,0 +1 @@
|
|||
nested=1
|
|
@ -51,3 +51,11 @@
|
|||
tags:
|
||||
- config
|
||||
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version|int == 7
|
||||
|
||||
#
|
||||
# Some virthosts we want to use nested virt (a tech preview in rhel 7.2)
|
||||
# We need this module option set and then need to tweak the libvirt xml to enable it
|
||||
#
|
||||
- name: setup nested virt on virthosts with nested=true variable
|
||||
copy: src=kvm_intel.conf dest=/etc/modprobe.d/kvm_intel.conf
|
||||
when: nested is true
|
Loading…
Add table
Add a link
Reference in a new issue