Skip to content

Commit

Permalink
Merge pull request #773 from zhasm/feature/rex-euler-comp-master
Browse files Browse the repository at this point in the history
兼容欧拉2022 LTS Sp1
  • Loading branch information
zexi committed Apr 28, 2023
2 parents a5c019b + 3b5dcd4 commit 04ceb81
Show file tree
Hide file tree
Showing 20 changed files with 269 additions and 53 deletions.
1 change: 1 addition & 0 deletions onecloud/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
host_key_checking=False
deprecation_warnings=False
command_warnings=False
pipelining = True
12 changes: 11 additions & 1 deletion onecloud/roles/common/tasks/centos_7_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
- "{{ 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 }}"

- name: install latest packages via loop
package:
Expand All @@ -24,6 +30,11 @@
enablerepo: "yunion-*"
with_items:
- "{{ latest_packages }}"
retries: 6
delay: 10
register: latest_pkg_result
until: latest_pkg_result.rc == 0
ignore_errors: yes
when:
- latest_packages is defined

Expand All @@ -44,4 +55,3 @@
state: disabled
when:
- selinux_conf_exists.stat.exists
- is_kylin_arm64 | default(false) | bool == false
4 changes: 2 additions & 2 deletions onecloud/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- name: Import task "{{ major_version_task_file }}"
include_tasks: "{{ major_version_task_file }}"

# onecloud/roles/common/tasks/
- name: Import OS Arch tasks
include_tasks: "{{ ansible_distribution | lower |replace(' ', '_')}}_{{ ansible_distribution_major_version |lower }}_{{ ansible_architecture }}.yml"

Expand Down Expand Up @@ -55,7 +56,7 @@
fi
done
args:
warn: no
executable: /bin/bash

- name: Config NetworkManager
include_role:
Expand Down Expand Up @@ -199,4 +200,3 @@
- name: Include cronjobs
include_role:
name: utils/cronjobs

1 change: 1 addition & 0 deletions onecloud/roles/common/tasks/openeuler_22_aarch64.yml
1 change: 1 addition & 0 deletions onecloud/roles/common/tasks/openeuler_22_x86_64.yml
10 changes: 10 additions & 0 deletions onecloud/roles/common/tasks/v3_10_online.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
when:
- is_centos_based is defined
- is_kylin_based|default(false)|bool == false
- is_openeuler_based|default(false)|bool == false

- name: Add cloud rpm repository for Kylin
get_url:
Expand All @@ -18,6 +19,15 @@
when:
- is_kylin_based|default(false)|bool == true

- name: Add cloud rpm repository for OpenEuler
get_url:
url: https://iso.yunion.cn/openeuler/{{ansible_distribution_major_version |lower}}/3.10/{{ansible_architecture}}/yunion.repo
dest: /etc/yum.repos.d/yunion-openeuler.repo
validate_certs: no
become: yes
when:
- is_openeuler_based|default(false)|bool == true

- name: make cache
shell: |
yum clean all
Expand Down
1 change: 0 additions & 1 deletion onecloud/roles/common/tasks/v3_9_online.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@
when:
- is_centos_aarch64 is defined


4 changes: 4 additions & 0 deletions onecloud/roles/mariadb/tasks/centos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
- online_status == "offline"
- offline_data_path is defined
- offline_data_path | length > 0

- name: set fact for socket
set_fact:
login_unix_socket: /var/lib/mysql/mysql.sock
4 changes: 4 additions & 0 deletions onecloud/roles/mariadb/tasks/debian-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@
name: mariadb
state: restarted
enabled: yes

- name: set fact for socket
set_fact:
login_unix_socket: /var/run/mysqld/mysqld.sock
4 changes: 4 additions & 0 deletions onecloud/roles/mariadb/tasks/debian-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
name: mariadb
state: restarted
enabled: yes

- name: set fact for socket
set_fact:
login_unix_socket: /var/run/mysqld/mysqld.sock
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
- name: pips for mysql/mariadb
pip:
name: PyMySQL

- name: set fact for socket
set_fact:
login_unix_socket: /var/lib/mysql/mysql.sock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Install mysql python for Kylin
- name: Install mysql python for RedHat based OS
package:
name: "{{ item }}"
state: installed
Expand All @@ -10,3 +10,7 @@
- name: pips for mysql/mariadb
pip:
name: PyMySQL

- name: set fact for socket
set_fact:
login_unix_socket: /var/lib/mysql/mysql.sock
26 changes: 2 additions & 24 deletions onecloud/roles/mariadb/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ./onecloud/roles/mariadb/tasks/
- name: Import Install mariadb task
include_tasks: "{{ ansible_distribution | lower | replace(' ', '_')}}-{{ ansible_architecture }}.yml"

Expand All @@ -15,6 +16,7 @@

- name: Change root password
mysql_user:
login_unix_socket: "{{ login_unix_socket }}"
login_user: "{{ db_user }}"
login_port: "{{ db_port | default(3306) }}"
login_password: "{{ db_password }}"
Expand All @@ -31,27 +33,3 @@
- "127.0.0.1"
vars:
ansible_python_interpreter: /usr/bin/python3
when:
- is_centos_based |default(false)|bool == true

- name: Change root password for debian
mysql_user:
login_unix_socket: /var/run/mysqld/mysqld.sock
login_user: "{{ db_user }}"
login_port: "{{ db_port | default(3306) }}"
login_password: "{{ db_password }}"
password: "{{ db_password }}"
name: "{{ db_user }}"
priv: '*.*:ALL,GRANT'
host: "{{ item }}"
check_implicit_admin: true
loop:
- "{{ db_host }}"
- "localhost"
- "%"
- "::1"
- "127.0.0.1"
when:
- is_debian_based |default(false)|bool == true
vars:
ansible_python_interpreter: /usr/bin/python3
1 change: 1 addition & 0 deletions onecloud/roles/mariadb/tasks/openeuler-aarch64.yml
1 change: 1 addition & 0 deletions onecloud/roles/mariadb/tasks/openeuler-x86_64.yml
4 changes: 4 additions & 0 deletions onecloud/roles/primary-master-node/setup_k8s/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@
when:
- join_as_host | 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 }}"
when: kubelet_result.rc != 0
Expand Down
79 changes: 79 additions & 0 deletions onecloud/roles/utils/detect-os/vars/openeuler-aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---

is_centos_based: true
is_openeuler_aarch64: true
is_openeuler_based: true

common_packages:
- bash-completion
- boost-iostreams
- boost-random
- boost-system
- boost-thread
- bridge-utils
- celt051
- ceph-common
- conntrack-tools
- curl
- docker-ce
- fuse
- fuse-devel
- fuse-libs
- gssproxy
- ipset
- ipvsadm
- jq
- keyutils
- kmod
- kmod-openvswitch
- kubeadm-1.15.12-0
- kubectl-1.15.12-0
- kubelet-1.15.12-0
- kubernetes-cni
- libbasicobjects
- libcollection
- libini_config
- libjpeg-turbo
- libnfsidmap
- libogg
- libpath_utils
- libpcap
- librados2
- librbd1
- libref_array
- libtirpc
- libusb
- libusbx
- libverto-libevent
- lm_sensors-libs
- nfs-utils
- nmap-ncat
- openvswitch
- parallel
- pixman
- python3-libselinux
- quota
- quota-nls
- rpcbind
- rsync
- sysstat
- tcp_wrappers
- tcpdump
- unbound
- unbound-libs
- usbredir
- usbutils
- wget
- "{{ yunion_qemu_package }}"

common_services:
- ntpd
- yunion-executor

latest_packages:
- ca-certificates
- yunion-climc
- yunion-executor
- yunion-fetcherfs
- yunion-ocadm
- yunion-ovmfrpm
79 changes: 79 additions & 0 deletions onecloud/roles/utils/detect-os/vars/openeuler-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---

is_centos_based: true
is_openeuler_x86: true
is_openeuler_based: true

common_packages:
- bash-completion
- boost-iostreams
- boost-random
- boost-system
- boost-thread
- bridge-utils
- celt051
- ceph-common
- conntrack-tools
- curl
- docker-ce
- fuse
- fuse-devel
- fuse-libs
- gssproxy
- ipset
- ipvsadm
- jq
- keyutils
- kmod
- kmod-openvswitch
- kubeadm-1.15.12-0
- kubectl-1.15.12-0
- kubelet-1.15.12-0
- kubernetes-cni
- libbasicobjects
- libcollection
- libini_config
- libjpeg-turbo
- libnfsidmap
- libogg
- libpath_utils
- libpcap
- librados2
- librbd1
- libref_array
- libtirpc
- libusb
- libusbx
- libverto-libevent
- lm_sensors-libs
- nfs-utils
- nmap-ncat
- openvswitch
- parallel
- pixman
- python3-libselinux
- quota
- quota-nls
- rpcbind
- rsync
- sysstat
- tcp_wrappers
- tcpdump
- unbound
- unbound-libs
- usbredir
- usbutils
- wget
- "{{ yunion_qemu_package }}"

common_services:
- ntpd
- yunion-executor

latest_packages:
- ca-certificates
- yunion-climc
- yunion-executor
- yunion-fetcherfs
- yunion-ocadm
- yunion-ovmfrpm
6 changes: 0 additions & 6 deletions onecloud/roles/utils/kernel-check/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
ignore_errors: yes
no_log: true
failed_when: false
args:
warn: no

- name: nbd facts
set_fact:
Expand All @@ -22,8 +20,6 @@
register: is_yunion_kernel_running
changed_when: false
failed_when: false
args:
warn: no

- name: Is cloud kernel installed
shell: |
Expand All @@ -32,8 +28,6 @@
register: is_yunion_kernel_installed
changed_when: false
failed_when: false
args:
warn: no

- name: check is_yunion_kernel_installed.rc {{ is_yunion_kernel_installed.rc }}
shell: echo is_yunion_kernel_installed.rc {{ is_yunion_kernel_installed.rc }}
Expand Down
Loading

0 comments on commit 04ceb81

Please sign in to comment.