diff --git a/onecloud/roles/clickhouse/deploy/tasks/main.yml b/onecloud/roles/clickhouse/deploy/tasks/main.yml index 2ba5fea2..05ce3d1c 100644 --- a/onecloud/roles/clickhouse/deploy/tasks/main.yml +++ b/onecloud/roles/clickhouse/deploy/tasks/main.yml @@ -38,4 +38,4 @@ when: - offline_data_path is defined - offline_data_path | length > 0 - - is_centos_x86 | default(false) | bool == true + - (is_centos_x86 | default(false) | bool == true) or (is_openeuler_x86 | default(false) | bool == true) diff --git a/onecloud/roles/clickhouse/install/tasks/main.yml b/onecloud/roles/clickhouse/install/tasks/main.yml index f74ff8e9..7f7fc4fe 100644 --- a/onecloud/roles/clickhouse/install/tasks/main.yml +++ b/onecloud/roles/clickhouse/install/tasks/main.yml @@ -84,4 +84,4 @@ when: - offline_data_path is defined - offline_data_path | length > 0 - - is_centos_x86 | default(false) | bool == true + - (is_centos_x86 | default(false) | bool == true) or (is_openeuler_x86 | default(false) | bool == true) diff --git a/onecloud/roles/clickhouse/install/tasks/openeuler.yml b/onecloud/roles/clickhouse/install/tasks/openeuler.yml new file mode 120000 index 00000000..fa2c37f2 --- /dev/null +++ b/onecloud/roles/clickhouse/install/tasks/openeuler.yml @@ -0,0 +1 @@ +centos.yml \ No newline at end of file diff --git a/onecloud/roles/common/tasks/centos_7_x86_64.yml b/onecloud/roles/common/tasks/centos_7_x86_64.yml index c929930b..af4e43dc 100644 --- a/onecloud/roles/common/tasks/centos_7_x86_64.yml +++ b/onecloud/roles/common/tasks/centos_7_x86_64.yml @@ -13,11 +13,6 @@ enablerepo: "yunion-*" with_items: - "{{ common_packages }}" - when: - - common_packages is defined - async: 1200 # Maximum allowed time in Seconds - poll: 0 # Polling Interval in Seconds - register: package_install loop_control: index_var: item_index label: "[{{ item_index + 1 }}/{{ common_packages|length }}] {{ item }}" @@ -45,6 +40,12 @@ when: - is_centos_x86 is defined +- name: Selinux Status + shell: | + sestatus |grep '^SELinux status:' |awk '{print $3}' + register: selinux_status + ignore_errors: yes + - name: Check that if selinux config exists stat: path: /etc/selinux/config @@ -54,4 +55,5 @@ selinux: state: disabled when: + - selinux_status.stdout | default("") != "disabled" - selinux_conf_exists.stat.exists diff --git a/onecloud/roles/primary-master-node/setup_k8s/tasks/main.yml b/onecloud/roles/primary-master-node/setup_k8s/tasks/main.yml index 779d43ea..fff247b4 100644 --- a/onecloud/roles/primary-master-node/setup_k8s/tasks/main.yml +++ b/onecloud/roles/primary-master-node/setup_k8s/tasks/main.yml @@ -163,13 +163,31 @@ when: - join_as_host | default(false)|bool == true + - block: + - name: Set cgroup driver to systemd in kubelet.service + lineinfile: + path: /usr/lib/systemd/system/kubelet.service + regexp: '^ExecStart=/usr/bin/kubelet$' + line: 'ExecStart=/usr/bin/kubelet --cgroup-driver=systemd' + + - name: reload systemd + ansible.builtin.systemd: + name: kubelet + state: restarted + daemon_reload: true + when: + is_openeuler_based | default(false) | bool == true + - name: show init args debug: msg: "/opt/yunion/bin/ocadm {{ init_args }}" - name: Use ocadm init first master node - command: "/opt/yunion/bin/ocadm {{ init_args }}" + shell: | + /opt/yunion/bin/ocadm {{ init_args }} when: kubelet_result.rc != 0 + args: + executable: /bin/bash - name: "Wait 500 seconds for primary master to response: {{ controlplane_endpoint }}" wait_for: