---
- hosts: stand-alone
vars:
- installation_package: openGauss-Lite-3.0.0-openEuler-x86_64.tar.gz
- password: password123!
- ansible_ip: 192.168.100.99
tasks:
- name: Install dependencies packages
yum:
name:
- flex
- bison
- ncurses-devel
- glibc-devel
- patch
- readline-devel
- libaio-devel
state: present
- name: Modify system configuration
shell: |
systemctl stop firewalld.service #关闭防火墙
systemctl disable firewalld.service
sed -i '/^SELINUX=.*/ c\SELINUX=disabled' /etc/selinux/config #关闭selinux
echo "export LC_CTYPE=zh_CN.GB18030" >> /etc/profile #统一字符集
echo "export LC_ALL=zh_CN.GB18030" >> /etc/profile
echo "export LANG=zh_CN.GB18030" >> /etc/profile
source /etc/profile
sed -i 's/^server/#server/g' /etc/chrony.conf #时间同步
sed -i "/^#server 0.*/ i\server {{ ansible_ip }} iburst" /etc/chrony.conf
systemctl restart chronyd.service
swapoff -a #关闭交换内存
sed -i 's/^#RemoveIPC/RemoveIPC/' /etc/systemd/logind.conf #关闭RemoveIPC
systemctl daemon-reload
systemctl restart systemd-logind
echo "500 641280 500 500" > /proc/sys/kernel/sem #修改信号集参数
- name: Create omm user
user:
name: omm
state: present
- name: Create installation directory
shell: |
mkdir -p /home/omm/openGauss/data
mkdir -p /home/omm/openGauss/install
- name: Download opengauss-Lite package
get_url:
url: https://opengauss.obs.cn-south-1.myhuaweicloud.com/3.0.0/x86_openEuler/{{ installation_package }}
dest: /tmp/
- name: Decompression opengauss-Lite package
unarchive:
src: /tmp/{{ installation_package }}
dest: /home/omm/openGauss/
copy: no
- name: Start up opengauss-Lite
shell: |
chown omm:omm -R /home/omm/openGauss/
su omm -l -c "echo {{password}} | sh /home/omm/openGauss/install.sh --mode single -D ~/openGauss/data -R ~/openGauss/install --start"