copr-hv: libvirtd bridge
This commit is contained in:
parent
f4a4919b49
commit
0e16e9d682
2 changed files with 36 additions and 12 deletions
|
@ -36,3 +36,7 @@ Manually created space for volumes/images:
|
||||||
|
|
||||||
1. lvcreate -n images -l 100%FREE vg_guests
|
1. lvcreate -n images -l 100%FREE vg_guests
|
||||||
2. mkfs.ext4 /dev/mapper/vg_guests-images -L vmvolumes
|
2. mkfs.ext4 /dev/mapper/vg_guests-images -L vmvolumes
|
||||||
|
|
||||||
|
Manually created br0 interface.
|
||||||
|
|
||||||
|
Not done by me, TODO: add steps.
|
||||||
|
|
|
@ -11,19 +11,27 @@
|
||||||
when: fstab_swap_entry.changed
|
when: fstab_swap_entry.changed
|
||||||
tags: swap
|
tags: swap
|
||||||
|
|
||||||
|
- name: install libvirtd.conf
|
||||||
|
copy: src="{{ files }}/virthost/libvirtd.conf" dest=/etc/libvirt/libvirtd.conf
|
||||||
|
notify:
|
||||||
|
- restart libvirtd
|
||||||
|
tags:
|
||||||
|
- libvirtd
|
||||||
|
- config
|
||||||
|
|
||||||
- set_fact: image_pool_dir=/libvirt-images
|
- set_fact: image_pool_dir=/libvirt-images
|
||||||
tags: libvirt
|
tags: libvirtd
|
||||||
|
|
||||||
- name: create libvirt image directory
|
- name: create libvirt image directory
|
||||||
file: path={{ image_pool_dir }}
|
file: path={{ image_pool_dir }}
|
||||||
owner=qemu group=qemu mode=0700
|
owner=qemu group=qemu mode=0700
|
||||||
state=directory
|
state=directory
|
||||||
tags: libvirt
|
tags: libvirtd
|
||||||
|
|
||||||
- name: mount libvirt image partition
|
- name: mount libvirt image partition
|
||||||
mount: name={{ image_pool_dir }} src='LABEL=vmvolumes'
|
mount: name={{ image_pool_dir }} src='LABEL=vmvolumes'
|
||||||
fstype=ext4 state=mounted
|
fstype=ext4 state=mounted
|
||||||
tags: libvirt
|
tags: libvirtd
|
||||||
|
|
||||||
- name: correct selinux
|
- name: correct selinux
|
||||||
sefcontext:
|
sefcontext:
|
||||||
|
@ -31,12 +39,31 @@
|
||||||
setype: virt_image_t
|
setype: virt_image_t
|
||||||
state: present
|
state: present
|
||||||
register: semanage_run
|
register: semanage_run
|
||||||
tags: libvirt
|
tags: libvirtd
|
||||||
|
|
||||||
- name: restorecon
|
- name: restorecon
|
||||||
shell: restorecon -irv "{{ image_pool_dir }}"
|
shell: restorecon -irv "{{ image_pool_dir }}"
|
||||||
when: semanage_run.changed
|
when: semanage_run.changed
|
||||||
tags: libvirt
|
tags: libvirtd
|
||||||
|
|
||||||
|
- name: check host-bridge in libvirt
|
||||||
|
shell: virsh net-info host-bridge
|
||||||
|
register: libvirt_bridge_exists
|
||||||
|
failed_when: false
|
||||||
|
changed_when: libvirt_bridge_exists.rc != 0
|
||||||
|
|
||||||
|
- name: copy host-bridge config file to host
|
||||||
|
copy: src=libvirt-net-bridge.xml
|
||||||
|
dest=/root/.tmp-ansible-file.xml
|
||||||
|
when: libvirt_bridge_exists.changed
|
||||||
|
|
||||||
|
- name: define host-bridge in libvirt
|
||||||
|
shell: |
|
||||||
|
virsh net-define /root/.tmp-ansible-file.xml
|
||||||
|
virsh net-start host-bridge
|
||||||
|
virsh net-autostart host-bridge
|
||||||
|
when: libvirt_bridge_exists.changed
|
||||||
|
notify: restart libvirtd
|
||||||
|
|
||||||
- name: create the copr user
|
- name: create the copr user
|
||||||
user: name=copr uid=11666
|
user: name=copr uid=11666
|
||||||
|
@ -62,12 +89,5 @@
|
||||||
- libvirt
|
- libvirt
|
||||||
- virt-install
|
- virt-install
|
||||||
|
|
||||||
- name: install libvirtd.conf
|
|
||||||
copy: src="{{ files }}/virthost/libvirtd.conf" dest=/etc/libvirt/libvirtd.conf
|
|
||||||
notify:
|
|
||||||
- restart libvirtd
|
|
||||||
tags:
|
|
||||||
- config
|
|
||||||
|
|
||||||
- name: add copr user to some virthosts that will run copr builders
|
- name: add copr user to some virthosts that will run copr builders
|
||||||
user: name=copr password_lock=true group=libvirt
|
user: name=copr password_lock=true group=libvirt
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue