48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
---
|
|
# tasklist for setting up the virthost server.
|
|
|
|
- name: set selinux to enforcing
|
|
selinux: policy=targeted state=enforcing
|
|
|
|
- name: install libvirt packages on rhel6 virthosts
|
|
yum: pkg={{ item }} state=present
|
|
with_items:
|
|
- qemu-kvm
|
|
- libvirt
|
|
- python-virtinst
|
|
tags:
|
|
- packages
|
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6'
|
|
|
|
- name: install libvirt packages on rhel7 virthosts
|
|
yum: pkg={{ item }} state=present
|
|
with_items:
|
|
- qemu-kvm
|
|
- libvirt
|
|
- virt-install
|
|
tags:
|
|
- packages
|
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
|
|
|
|
# install libvirtd.conf
|
|
#
|
|
# This provides us with the ability to use virt-manager from non root accounts.
|
|
#
|
|
- name: install libvirtd.conf
|
|
copy: src="{{ files }}/virthost/libvirtd.conf" dest=/etc/libvirt/libvirtd.conf
|
|
notify:
|
|
- restart libvirtd
|
|
tags:
|
|
- config
|
|
|
|
- name: enable libvirtd
|
|
service: name=libvirtd state=started enabled=yes
|
|
|
|
- name: set bridging to work right -
|
|
copy: src="{{ files }}/virthost/99-bridge.rules" dest=/etc/udev/rules.d/99-bridge.rules
|
|
notify:
|
|
- restart bridge
|
|
tags:
|
|
- config
|
|
when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
|