|
18 | 18 | msg: "SUSE Specific KVM host Build" |
19 | 19 |
|
20 | 20 | - name: Ensure selinux python bindings are installed (Ansible requirement) |
21 | | - zypper: |
22 | | - name: python3-selinux |
23 | | - state: present |
| 21 | + shell: "zypper install -y python3-selinux" |
24 | 22 | tags: |
25 | 23 | - kvm |
26 | 24 | ignore_errors: yes |
27 | 25 |
|
| 26 | +- name: install net-tools |
| 27 | + shell: "zypper install -y net-tools" |
| 28 | + |
| 29 | +- name: install net-tools |
| 30 | + shell: "zypper install -y net-tools-deprecated" |
| 31 | + ignore_errors: yes # This package is deprecated. ignoring errors for older distros |
| 32 | + |
28 | 33 | - name: Set selinux to permissive |
29 | 34 | command: setenforce permissive |
30 | 35 | changed_when: false |
|
38 | 43 | - kvm |
39 | 44 | ignore_errors: yes |
40 | 45 |
|
41 | | -- include: ./kvm_networking_bridge_suse.yml |
| 46 | +- include: ./kvm_networking_bridge8.yml |
42 | 47 | when: (not use_phys_hosts) and (kvm_network_mode == "bridge") |
43 | 48 |
|
44 | 49 | - include: ./kvm_networking_ovs_suse.yml |
|
55 | 60 | # Don't really need suse for phy hosts |
56 | 61 |
|
57 | 62 | - name: Install basic utilities and tools - all versions |
58 | | - zypper: name={{ item }} state=present update_cache=yes |
59 | | - with_items: |
60 | | - - bind-utils |
61 | | - - openssh |
62 | | - - pciutils |
63 | | - - telnet |
64 | | - - tcpdump |
65 | | - - traceroute |
66 | | - - nano |
67 | | - - iftop |
68 | | - - rpcbind |
69 | | - - parted |
70 | | - - vim |
| 63 | + shell: "zypper install -y bind-utils openssh pciutils telnet tcpdump traceroute nano iftop rpcbind parted vim" |
71 | 64 | tags: |
72 | 65 | - kvm |
73 | 66 |
|
|
125 | 118 | - kvm-agent |
126 | 119 |
|
127 | 120 | - name: Update /etc/sysconfig/libvirtd - LIBVIRTD_ARGS |
128 | | - lineinfile: dest=/etc/sysconfig/libvirtd regexp='LIBVIRTD_ARGS' line='LIBVIRTD_ARGS="--listen"' state=present |
| 121 | + lineinfile: dest=/etc/sysconfig/libvirtd regexp='LIBVIRTD_ARGS' line='LIBVIRTD_ARGS="--listen"' state=present create=yes |
129 | 122 | tags: |
130 | 123 | - kvm |
131 | 124 | - kvm-agent |
132 | 125 |
|
133 | | -- name: Mask libvirtd sockets |
134 | | - shell: systemctl mask libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket |
| 126 | +- name: Reload systemd daemon after libvirtd service modification |
| 127 | + command: systemctl daemon-reload |
| 128 | + tags: |
| 129 | + - kvm |
| 130 | + - kvm-agent |
135 | 131 |
|
136 | 132 | - name: Update /etc/libvirt/qemu.conf |
137 | 133 | lineinfile: dest=/etc/libvirt/qemu.conf regexp='vnc_listen' line='vnc_listen = "0.0.0.0"' state=present |
138 | 134 | tags: |
139 | 135 | - kvm |
140 | 136 | - kvm-agent |
141 | 137 |
|
| 138 | +- name: Mask libvirtd sockets |
| 139 | + shell: systemctl mask libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd-tls.socket libvirtd-tcp.socket |
| 140 | + |
| 141 | +- name: Mask virtqemu sockets |
| 142 | + shell: systemctl mask virtqemud.socket virtqemud-ro.socket virtqemud-admin.socket virtqemud virtnetworkd virtstoraged |
| 143 | + |
| 144 | +- name: Enable libvirtd service on reboot |
| 145 | + shell: systemctl enable --now libvirtd |
| 146 | + tags: |
| 147 | + - kvm |
| 148 | + - kvm-agent |
| 149 | + |
142 | 150 | - name: Add iptables rules |
143 | 151 | shell: "iptables -I INPUT -p tcp -m tcp --dport {{ item }} -j ACCEPT" |
144 | 152 | with_items: |
|
0 commit comments