From 744613f4265664ce45b3fc767f8a0c1908b7da61 Mon Sep 17 00:00:00 2001 From: wangjian Date: Thu, 4 Jul 2024 15:57:53 +0800 Subject: [PATCH 1/2] add ansible-playbook for PilotGo platform install part of redis6 --- docs/install_guide.md | 2 +- scripts/playbook/host-standalone | 2 ++ scripts/playbook/install_PilotGo.yaml | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 scripts/playbook/host-standalone create mode 100644 scripts/playbook/install_PilotGo.yaml diff --git a/docs/install_guide.md b/docs/install_guide.md index 5d111842..58ad1540 100644 --- a/docs/install_guide.md +++ b/docs/install_guide.md @@ -68,4 +68,4 @@ file:输出到path下的指定文件。 ```bash # agent端启动 $ ./agent & -``` \ No newline at end of file +``` diff --git a/scripts/playbook/host-standalone b/scripts/playbook/host-standalone new file mode 100644 index 00000000..9ee0aa60 --- /dev/null +++ b/scripts/playbook/host-standalone @@ -0,0 +1,2 @@ +[standalone] +1.1.1.1 \ No newline at end of file diff --git a/scripts/playbook/install_PilotGo.yaml b/scripts/playbook/install_PilotGo.yaml new file mode 100644 index 00000000..79eadcc4 --- /dev/null +++ b/scripts/playbook/install_PilotGo.yaml @@ -0,0 +1,14 @@ +--- +- name: install PilotGo platform + hosts: standalone + become: yes + become_user: root + tasks: + - name: install redis 6 through euler repo + dnf: + name: redis6-6.2.7-3 + state: present + - name: restart redis service + service: + name: redis + state: restarted \ No newline at end of file -- Gitee From 272fa68514b9577a66cdd9caa3172b49eb80c44c Mon Sep 17 00:00:00 2001 From: wangjian Date: Thu, 4 Jul 2024 17:12:26 +0800 Subject: [PATCH 2/2] add redis4 uninstall and redis6 config change operations --- scripts/playbook/group_vars/all | 2 ++ scripts/playbook/install_PilotGo.yaml | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 scripts/playbook/group_vars/all diff --git a/scripts/playbook/group_vars/all b/scripts/playbook/group_vars/all new file mode 100644 index 00000000..31374876 --- /dev/null +++ b/scripts/playbook/group_vars/all @@ -0,0 +1,2 @@ +--- +redis_password: "PilotGo13579!" \ No newline at end of file diff --git a/scripts/playbook/install_PilotGo.yaml b/scripts/playbook/install_PilotGo.yaml index 79eadcc4..34cdbb31 100644 --- a/scripts/playbook/install_PilotGo.yaml +++ b/scripts/playbook/install_PilotGo.yaml @@ -3,11 +3,29 @@ hosts: standalone become: yes become_user: root - tasks: + tasks: + - name: check redis rpm + shell: rpm -qa | grep -e 'redis*4*' + register: rpm_info + ignore_errors: yes + - name: uninstall redis4 + dnf: + name: redis + state: absent + when: rpm_info.rc == 0 - name: install redis 6 through euler repo dnf: - name: redis6-6.2.7-3 + name: redis6 state: present + ignore_errors: yes + - name: change redis.conf + shell: sed -i 's#bind 0.0.0.0#bind {{ groups['standalone'][0] }}#g' /etc/redis/redis.conf + - name: change passwd + lineinfile: + path: /etc/redis/redis.conf + regexp: '^#?requirepass' + line: 'requirepass {{ redis_password }}' + backrefs: yes - name: restart redis service service: name: redis -- Gitee