2013-06-24 20:01:51 +00:00
|
|
|
---
|
|
|
|
# tasklist for setting up the virthost server.
|
|
|
|
|
|
|
|
- name: set selinux to enforcing
|
|
|
|
selinux: policy=targeted state=enforcing
|
|
|
|
|
2014-06-20 23:26:54 +00:00
|
|
|
- name: install libvirt packages on rhel6 virthosts
|
2014-10-29 09:08:40 +05:30
|
|
|
yum: pkg={{ item }} state=present
|
2013-06-24 20:01:51 +00:00
|
|
|
with_items:
|
|
|
|
- qemu-kvm
|
2013-07-05 22:13:17 +00:00
|
|
|
- libvirt
|
2013-06-24 20:01:51 +00:00
|
|
|
- python-virtinst
|
|
|
|
tags:
|
|
|
|
- packages
|
2014-06-23 21:51:16 +00:00
|
|
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6'
|
2014-06-20 23:26:54 +00:00
|
|
|
|
|
|
|
- name: install libvirt packages on rhel7 virthosts
|
2014-10-29 09:08:40 +05:30
|
|
|
yum: pkg={{ item }} state=present
|
2014-06-20 23:26:54 +00:00
|
|
|
with_items:
|
|
|
|
- qemu-kvm
|
|
|
|
- libvirt
|
|
|
|
- virt-install
|
|
|
|
tags:
|
|
|
|
- packages
|
2014-06-23 21:51:16 +00:00
|
|
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
|
2013-06-24 20:01:51 +00:00
|
|
|
|
|
|
|
# install libvirtd.conf
|
|
|
|
#
|
|
|
|
# This provides us with the ability to use virt-manager from non root accounts.
|
|
|
|
#
|
|
|
|
- name: install libvirtd.conf
|
2014-01-01 19:15:11 +00:00
|
|
|
copy: src="{{ files }}/virthost/libvirtd.conf" dest=/etc/libvirt/libvirtd.conf
|
2013-06-24 20:01:51 +00:00
|
|
|
notify:
|
|
|
|
- restart libvirtd
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
|
|
|
- name: enable libvirtd
|
|
|
|
service: name=libvirtd state=started enabled=yes
|
2014-10-08 21:03:20 +00:00
|
|
|
|
|
|
|
- name: set bridging to work right -
|
2014-10-08 21:43:53 +00:00
|
|
|
copy: src="{{ files }}/virthost/99-bridge.rules" dest=/etc/udev/rules.d/99-bridge.rules
|
2014-10-08 21:03:20 +00:00
|
|
|
notify:
|
|
|
|
- restart bridge
|
|
|
|
tags:
|
|
|
|
- config
|
2014-10-09 00:35:03 +00:00
|
|
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
|