Skip to content

Commit 969c3cb

Browse files
authored
Merge pull request #207 from shapeblue/suse-15-6-compat
OpenSUSE 15.6 compatibility changes
2 parents 23eb9fc + aa4f3dd commit 969c3cb

File tree

8 files changed

+52
-68
lines changed

8 files changed

+52
-68
lines changed

Ansible/roles/cloudmonkey/tasks/suse.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
#limitations under the License.
1616

1717
- name: install jq
18-
zypper:
19-
name: jq
20-
state: latest
18+
shell: "zypper install -y jq"
2119

2220
- name: ensure cm config is removed
2321
file: path=/root/.cloudmonkey/config state=absent

Ansible/roles/cloudstack-manager/tasks/suse-acs.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,10 @@
1818
template: src=cloudstack.repo.j2 dest=/etc/zypp/repos.d/cloudstack.repo
1919

2020
- name: Ensure CloudStack packages are installed
21-
zypper:
22-
name:
23-
- "{{ cloudstack_management_package }}*"
24-
- "{{ cloudstack_common_package }}*"
25-
state: present
21+
shell: "zypper install -y {{ cloudstack_management_package }}* {{ cloudstack_common_package }}*"
2622

2723
- name: Ensure MySQL Client is present
28-
zypper:
29-
name: mysql
30-
state: present
24+
shell: "zypper install -y mysql"
3125

3226
- name: Fix messed up python mysql ssl libs
3327
copy:
@@ -47,7 +41,7 @@
4741
get_url: url="{{ vhdutil_url }}" dest=/usr/share/cloudstack-common/scripts/vm/hypervisor/xenserver/vhd-util mode=0755
4842

4943
- name: Ensure CloudStack Usage Service is installed
50-
zypper: name="{{ cloudstack_usage_package }}*" state=present
44+
shell: "zypper install -y {{ cloudstack_usage_package }}*"
5145

5246
- include: ./setupdb.yml
5347

Ansible/roles/cloudstack-manager/tasks/suse.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
msg: "SUSE Specific Management Server Build"
1919

2020
- 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"
2422
ignore_errors: yes
2523

2624
- name: Set selinux to permissive
@@ -51,19 +49,19 @@
5149
when: use_firewalld|bool == False
5250

5351
- name: Ensure CA Certs are latest
54-
zypper: name=ca-certificates state=latest
52+
shell: "zypper install -y ca-certificates"
5553

5654
- name: install rng-tools to get entropy
57-
zypper: name=haveged state=present
55+
shell: "zypper install -y haveged"
5856

5957
- name: determine number of db hosts
6058
set_fact: num_xen_hosts="{{ groups['xenserver_hosts'] | length }}"
6159

6260
- name: update lvm2 as fix for bugzilla.redhat.com/show_bug.cgi?id=1294128
63-
zypper: name=lvm2 state=latest
61+
shell: "zypper install -y lvm2"
6462

6563
- name: install qemu-tools
66-
zypper: name=qemu-tools state=present
64+
shell: "zypper install -y qemu-tools"
6765

6866
- debug: msg="Set Java on VM"
6967
- set_fact: java_ver="{{ mgmt_java_ver }}"
@@ -79,9 +77,7 @@
7977
# Don't really need suse support for ccp
8078

8179
- name: ensure rpcbind in installed
82-
zypper:
83-
name: rpcbind
84-
state: present
80+
shell: "zypper install -y rpcbind"
8581

8682
- name: ensure rpcbind in started
8783
service:
@@ -93,7 +89,7 @@
9389
when: (num_marv_hosts > 0)
9490

9591
- name: Ensure sshpass is installed
96-
zypper: name=sshpass state=present
92+
shell: "zypper install -y sshpass"
9793
when: (num_marv_hosts > 0)
9894

9995
- name: Open 8096 when Marvin is required

Ansible/roles/kvm/tasks/kvm_networking_ovs_suse.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
template: src=bridge-blacklist.j2 dest="/etc/modprobe.d/bridge-blacklist.conf"
2222

2323
- name: Install OVS
24-
zypper: name={{ item }} state=present
25-
with_items:
26-
- openvswitch
27-
- openvswitch-switch
24+
shell: "zypper install -y openvswitch openvswitch-switch"
2825

2926
- name: Start OVS
3027
systemd:

Ansible/roles/kvm/tasks/suse-acs.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@
2525
- kvm-agent
2626

2727
- name: Ensure CloudStack packages are installed
28-
zypper:
29-
name:
30-
- "{{ cloudstack_agent_package }}*"
31-
- "{{ cloudstack_common_package }}*"
32-
state: present
33-
update_cache: yes
28+
shell: "zypper install -y {{ cloudstack_agent_package }}* {{ cloudstack_common_package }}*"
3429
tags:
3530
- kvm
3631
- kvm-agent

Ansible/roles/kvm/tasks/suse.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@
1818
msg: "SUSE Specific KVM host Build"
1919

2020
- 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"
2422
tags:
2523
- kvm
2624
ignore_errors: yes
2725

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+
2833
- name: Set selinux to permissive
2934
command: setenforce permissive
3035
changed_when: false
@@ -38,7 +43,7 @@
3843
- kvm
3944
ignore_errors: yes
4045

41-
- include: ./kvm_networking_bridge_suse.yml
46+
- include: ./kvm_networking_bridge8.yml
4247
when: (not use_phys_hosts) and (kvm_network_mode == "bridge")
4348

4449
- include: ./kvm_networking_ovs_suse.yml
@@ -55,19 +60,7 @@
5560
# Don't really need suse for phy hosts
5661

5762
- 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"
7164
tags:
7265
- kvm
7366

@@ -125,20 +118,35 @@
125118
- kvm-agent
126119

127120
- 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
129122
tags:
130123
- kvm
131124
- kvm-agent
132125

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
135131

136132
- name: Update /etc/libvirt/qemu.conf
137133
lineinfile: dest=/etc/libvirt/qemu.conf regexp='vnc_listen' line='vnc_listen = "0.0.0.0"' state=present
138134
tags:
139135
- kvm
140136
- kvm-agent
141137

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+
142150
- name: Add iptables rules
143151
shell: "iptables -I INPUT -p tcp -m tcp --dport {{ item }} -j ACCEPT"
144152
with_items:

Ansible/roles/mysql/tasks/suse.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,13 @@
3434
- mysqlconf
3535

3636
- name: Ensure selinux and mysql python bindings are installed (Ansible requirement)
37-
zypper:
38-
name:
39-
- python3-PyMySQL
40-
- python3-selinux
41-
state: present
37+
shell: "zypper install -y python3-PyMySQL python3-mysql-connector-python"
4238
tags:
4339
- mysql
4440
- mysqlconf
4541

4642
- name: Ensure selinux python bindings are installed (Ansible requirement)
47-
zypper:
48-
name: python3-selinux
49-
state: present
43+
shell: "zypper install -y python3-selinux"
5044
tags:
5145
- mysql
5246
- mysqlconf
@@ -66,11 +60,16 @@
6660
- kvm
6761
ignore_errors: yes
6862

63+
- name: Check if mysql server is installed
64+
shell: rpm -q mysql-server
65+
register: mysql_check
66+
failed_when: false
67+
changed_when: false
68+
6969
- name: Ensure mysql server is installed
70-
zypper:
71-
name: mysql-server
72-
state: present
70+
shell: "zypper install -y mysql-server"
7371
register: mysqlinstalled
72+
when: mysql_check.rc != 0
7473
tags:
7574
- mysql
7675
- mysqlconf

Ansible/roles/timezone/tasks/suse.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
command: "timedatectl set-timezone {{ env_timezone }}"
1919

2020
- name: Install chrony
21-
zypper:
22-
name: chrony
23-
state: present
24-
update_cache: yes
21+
shell: zypper install -y chrony
2522

2623
- name: Start chrony SUSE
2724
service:

0 commit comments

Comments
 (0)