From 91d9578edf814a24cdf2deffc47dfcef773c864e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 6 Jul 2020 12:08:22 +0530 Subject: [PATCH 1/4] fixes Signed-off-by: Abhishek Kumar --- Ansible/roles/kvm/tasks/centos.yml | 26 +++++++++++++++++--------- Ansible/roles/timezone/tasks/main.yml | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Ansible/roles/kvm/tasks/centos.yml b/Ansible/roles/kvm/tasks/centos.yml index 569d82749b3..73e82807168 100644 --- a/Ansible/roles/kvm/tasks/centos.yml +++ b/Ansible/roles/kvm/tasks/centos.yml @@ -5,9 +5,9 @@ tags: - kvm -- name: CentOS 7 hostname fixup +- name: CentOS 7/8 hostname fixup file: path=/etc/hostname state=absent - when: ansible_distribution_major_version == "7" + when: ansible_distribution_major_version|int >= 7 tags: - kvm @@ -75,20 +75,28 @@ tags: - kvm -- name: Firewalld for CentOS7 +- name: Install chrony for centos8 + yum: name={{ item }} state=present enablerepo=base + with_items: + - chrony + tags: + - kvm + when: ( ansible_distribution_major_version > "8" ) + +- name: Firewalld for CentOS7/CentOS8 yum: name={{ item }} state=present enablerepo=base with_items: - firewalld tags: - kvm - when: ( ansible_distribution_major_version == "7" ) and use_firewalld + when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld -- name: Start firewalld CentOS7 +- name: Start firewalld CentOS7/CentOS8 service: name=firewalld state=started enabled=yes - when: ( ansible_distribution_major_version == "7" ) and use_firewalld + when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld - include: ./add_local_storage.yml when: use_local_storage @@ -136,7 +144,7 @@ - name: Bugfix libvirt cpu issue on ACS 4.5 (CLOUDSTACK-8443) shell: sed -i -e '/cgroup\_controllers/d' /usr/lib64/python2.7/site-packages/cloudutils/serviceConfig.py - when: (ansible_distribution_major_version == "7") and (env_numversion | version_compare('4.9','<=')) + when: (ansible_distribution_major_version|int >= 7) and (env_numversion | version_compare('4.9','<=')) tags: - kvm - kvm-agent @@ -162,7 +170,7 @@ - "16509" - "5900-6100" - "49152-49216" - when: ( ansible_distribution_major_version == "7" ) and use_firewalld + when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld tags: - kvm - kvm-agent @@ -176,7 +184,7 @@ - name: load updated config shell: "firewall-cmd --reload" - when: ( ansible_distribution_major_version == "7" ) and use_firewalld + when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld tags: - kvm - kvm-agent diff --git a/Ansible/roles/timezone/tasks/main.yml b/Ansible/roles/timezone/tasks/main.yml index 111bacdd51c..79e1ca366ee 100644 --- a/Ansible/roles/timezone/tasks/main.yml +++ b/Ansible/roles/timezone/tasks/main.yml @@ -16,7 +16,7 @@ when: ( ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' ) and ( ansible_distribution_major_version == "6" ) - include: ./centos7.yml - when: ( ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' ) and ( ansible_distribution_major_version == "7" ) + when: ( ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' ) and ( ansible_distribution_major_version|int >= 7 ) - include: ./ubuntu.yml when: ansible_distribution == 'Ubuntu' From 0b9fa6dee744fb0ce7e9ac973a47f01b73faeca9 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 6 Jul 2020 12:27:48 +0530 Subject: [PATCH 2/4] revert Signed-off-by: Abhishek Kumar --- Ansible/roles/kvm/tasks/centos.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Ansible/roles/kvm/tasks/centos.yml b/Ansible/roles/kvm/tasks/centos.yml index 73e82807168..569d82749b3 100644 --- a/Ansible/roles/kvm/tasks/centos.yml +++ b/Ansible/roles/kvm/tasks/centos.yml @@ -5,9 +5,9 @@ tags: - kvm -- name: CentOS 7/8 hostname fixup +- name: CentOS 7 hostname fixup file: path=/etc/hostname state=absent - when: ansible_distribution_major_version|int >= 7 + when: ansible_distribution_major_version == "7" tags: - kvm @@ -75,28 +75,20 @@ tags: - kvm -- name: Install chrony for centos8 - yum: name={{ item }} state=present enablerepo=base - with_items: - - chrony - tags: - - kvm - when: ( ansible_distribution_major_version > "8" ) - -- name: Firewalld for CentOS7/CentOS8 +- name: Firewalld for CentOS7 yum: name={{ item }} state=present enablerepo=base with_items: - firewalld tags: - kvm - when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld + when: ( ansible_distribution_major_version == "7" ) and use_firewalld -- name: Start firewalld CentOS7/CentOS8 +- name: Start firewalld CentOS7 service: name=firewalld state=started enabled=yes - when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld + when: ( ansible_distribution_major_version == "7" ) and use_firewalld - include: ./add_local_storage.yml when: use_local_storage @@ -144,7 +136,7 @@ - name: Bugfix libvirt cpu issue on ACS 4.5 (CLOUDSTACK-8443) shell: sed -i -e '/cgroup\_controllers/d' /usr/lib64/python2.7/site-packages/cloudutils/serviceConfig.py - when: (ansible_distribution_major_version|int >= 7) and (env_numversion | version_compare('4.9','<=')) + when: (ansible_distribution_major_version == "7") and (env_numversion | version_compare('4.9','<=')) tags: - kvm - kvm-agent @@ -170,7 +162,7 @@ - "16509" - "5900-6100" - "49152-49216" - when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld + when: ( ansible_distribution_major_version == "7" ) and use_firewalld tags: - kvm - kvm-agent @@ -184,7 +176,7 @@ - name: load updated config shell: "firewall-cmd --reload" - when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld + when: ( ansible_distribution_major_version == "7" ) and use_firewalld tags: - kvm - kvm-agent From da85b0bd4c330b867980f9dfc808aa1e190186f8 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 6 Jul 2020 13:03:31 +0530 Subject: [PATCH 3/4] disable firewalld when use_firewalld=false Signed-off-by: Abhishek Kumar --- Ansible/roles/kvm/tasks/centos8.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Ansible/roles/kvm/tasks/centos8.yml b/Ansible/roles/kvm/tasks/centos8.yml index c278834e355..d4795abc6b7 100644 --- a/Ansible/roles/kvm/tasks/centos8.yml +++ b/Ansible/roles/kvm/tasks/centos8.yml @@ -101,6 +101,13 @@ enabled=yes when: ( ansible_distribution_major_version|int >= 7 ) and use_firewalld +- name: Stop firewalld CentOS7/8 + service: + name=firewalld + state=stopped + enabled=no + when: ( ansible_distribution_major_version|int >= 7 ) and (use_firewalld|bool == False) + - include: ./add_local_storage.yml when: use_local_storage tags: From cc9e49d1f4c00855ee116ad6902b63b9975e5e95 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 6 Jul 2020 13:34:38 +0530 Subject: [PATCH 4/4] ipmitool workaround Signed-off-by: Abhishek Kumar --- Ansible/roles/cloudstack-manager/tasks/centos8.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Ansible/roles/cloudstack-manager/tasks/centos8.yml b/Ansible/roles/cloudstack-manager/tasks/centos8.yml index f0c550eb541..877f9419353 100644 --- a/Ansible/roles/cloudstack-manager/tasks/centos8.yml +++ b/Ansible/roles/cloudstack-manager/tasks/centos8.yml @@ -100,3 +100,7 @@ #- name: Open 8096 when Marvin is required (CentOS 7) # shell: firewall-cmd --permanent --zone=public --add-port=8096/tcp && firewall-cmd --reload # when: (num_marv_hosts > 0) and (ansible_distribution_major_version == "7") + +# Workaround for https://github.com/apache/cloudstack/issues/4204 +- name: Patch ipmitool yo ipmitool-1.8.18-12.el8_1.x86_64.rpm + shell: "rpm -i https://rpmfind.net/linux/centos/8.1.1911/AppStream/x86_64/os/Packages/ipmitool-1.8.18-12.el8_1.x86_64.rpm --force"