File tree 9 files changed +21
-19
lines changed
9 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
3
3
- name : reload systemd
4
- systemd :
4
+ ansible.builtin. systemd :
5
5
daemon_reload : true
6
6
become : true
7
7
8
8
# The socket units cannot be stopped or started if libvirt is running.
9
9
- name : stop libvirt
10
- service :
10
+ ansible.builtin. service :
11
11
name : libvirtd
12
12
state : stopped
13
13
become : true
14
14
listen :
15
15
- restart libvirt
16
16
17
17
- name : start libvirtd sockets
18
- service :
18
+ ansible.builtin. service :
19
19
name : " {{ item.service }}"
20
20
state : " {{ item.enabled | bool | ternary('started', 'stopped') }}"
21
21
become : true
26
26
- restart libvirt
27
27
28
28
- name : start libvirt
29
- service :
29
+ ansible.builtin. service :
30
30
name : libvirtd
31
31
state : started
32
32
become : true
33
33
34
34
- name : reload libvirt qemu apparmor profile template
35
- command : apparmor_parser -r /etc/apparmor.d/libvirt/TEMPLATE.qemu
35
+ ansible.builtin. command : apparmor_parser -r /etc/apparmor.d/libvirt/TEMPLATE.qemu
36
36
become : true
Original file line number Diff line number Diff line change 30
30
- role : tcharl.ansible_role_libvirt_host
31
31
tasks :
32
32
- name : " Post converge - Install vagrant"
33
- package :
33
+ ansible.builtin. package :
34
34
name :
35
35
- qemu
36
36
- libvirt
46
46
become : true
47
47
48
48
- name : Start libvirtd
49
- service :
49
+ ansible.builtin. service :
50
50
name : libvirtd
51
51
state : started
52
52
become : true
53
53
54
54
- name : Copy vagrant file
55
- copy :
55
+ ansible.builtin. copy :
56
56
src : Vagrantfile
57
57
dest : /home/vagrant/Vagrantfile
58
58
owner : vagrant
59
59
group : vagrant
60
60
mode : ' 0644'
61
61
62
62
- name : Execute Vagrant as daemon
63
- command :
63
+ ansible.builtin. command :
64
64
cmd : " daemonize -e /home/vagrant/myvmerr.log -o /home/vagrant/myvm.log -c /home/vagrant -E VAGRANT_LOG=info /usr/bin/vagrant up --provider=libvirt"
65
65
chdir : /home/vagrant
66
66
creates : /home/vagrant/myvm.log
67
67
68
68
- name : Wait until the string "auth" is in the vagrant log
69
- wait_for :
69
+ ansible.builtin. wait_for :
70
70
path : /home/vagrant/myvmerr.log
71
71
search_regex : SSH\sis\sready
72
72
timeout : 1800
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ lint: |
12
12
set -e
13
13
yamllint .
14
14
flake8
15
- ANSIBLE_ROLES_PATH=${MOLECULE_PROJECT_DIRECTORY}/../ community ANSIBLE_COLLECTIONS_PATH=${MOLECULE_PROJECT_DIRECTORY}/../community-collections ansible-lint
15
+ ANSIBLE_ROLES_PATH=${MOLECULE_PROJECT_DIRECTORY}/..:${MOLECULE_PROJECT_DIRECTORY}/../ community:${ANSIBLE_ROLES_PATH} ANSIBLE_COLLECTIONS_PATH=${MOLECULE_PROJECT_DIRECTORY}/../community-collections:${ANSIBLE_COLLECTIONS_PATH} ansible-lint
16
16
platforms :
17
17
- name : Fedora-Molecule-libvirt-host
18
18
box : fedora/35-cloud-base
Original file line number Diff line number Diff line change 26
26
- role : tcharl.ansible_role_libvirt_host
27
27
tasks :
28
28
- name : " Post converge - Install vagrant"
29
- package :
29
+ ansible.builtin. package :
30
30
name :
31
31
- qemu
32
32
- libvirt
42
42
become : true
43
43
44
44
- name : Start libvirtd
45
- service :
45
+ ansible.builtin. service :
46
46
name : libvirtd
47
47
state : started
48
48
become : true
49
49
50
50
- name : Copy vagrant file
51
- copy :
51
+ ansible.builtin. copy :
52
52
src : Vagrantfile
53
53
dest : /home/vagrant/Vagrantfile
54
54
owner : vagrant
55
55
group : vagrant
56
56
mode : ' 0644'
57
57
58
58
- name : Execute Vagrant as daemon
59
- command :
59
+ ansible.builtin. command :
60
60
cmd : " daemonize -e /home/vagrant/myvmerr.log -o /home/vagrant/myvm.log -c /home/vagrant -E VAGRANT_LOG=info /usr/bin/vagrant up --provider=libvirt"
61
61
chdir : /home/vagrant
62
62
creates : /home/vagrant/myvm.log
63
63
64
64
- name : Wait until the string "auth" is in the vagrant log
65
- wait_for :
65
+ ansible.builtin. wait_for :
66
66
path : /home/vagrant/myvmerr.log
67
67
search_regex : SSH\sis\sready
68
68
timeout : 1800
Original file line number Diff line number Diff line change 1
1
---
2
2
- name : Ensure client configuration files exist
3
- template :
3
+ ansible.builtin. template :
4
4
src : " {{ item.src }}"
5
5
dest : " {{ item.dest }}"
6
6
owner : " {{ item.owner }}"
Original file line number Diff line number Diff line change 1
1
<network {% if item.ipv6 is defined %}ipv6 =' yes' {% endif %} connections =' 1' >
2
2
<name >{{ item.name }}</name >
3
- <forward mode =' {{ item.mode }}' />
3
+ {% if item . mode is defined %} <forward mode =' {{ item.mode }}' />{% endif %}
4
4
<bridge name =' {{ item.bridge }}' {% if item.zone is defined %} zone =' {{ item.zone }}' {% endif %} />
5
- {% if item .mode == 'route' or item .mode == ' nat' %}
5
+ {% if item .mode is not defined or item .mode in [ 'route' , ' nat'] %}
6
6
<domain name =' {{ item.domain|default(item.name) }}' />
7
7
<ip address =' {{ item.ip }}' netmask =' {{ item.netmask }}' >
8
8
{% if item .dhcp_start is defined and item .dhcp_end is defined %}
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ libvirt_host_packages_efi_by_version:
23
23
- qemu-kvm-ev # Need smm support for secure boot
24
24
8 :
25
25
- edk2-ovmf
26
+ 35 : [] # fedora
26
27
27
28
libvirt_host_packages_efi : >-
28
29
{{ libvirt_host_packages_efi_by_version[ansible_facts.distribution_major_version | int] }}
@@ -53,6 +54,7 @@ libvirt_host_custom_yum_repos_efi_by_version:
53
54
baseurl : http://mirror.centos.org/$contentdir/$releasever/virt/$basearch/kvm-common/
54
55
gpgcheck : yes
55
56
8 : []
57
+ 35 : [] # Fedora :-)
56
58
57
59
libvirt_host_custom_yum_repos : >-
58
60
{{ libvirt_host_custom_yum_repos_efi_by_version[ansible_facts.distribution_major_version | int] }}
You can’t perform that action at this time.
0 commit comments