From eae43cb1e8b08d683179f901b44080b9a196eca6 Mon Sep 17 00:00:00 2001 From: wangjian Date: Thu, 21 Nov 2024 17:35:22 +0800 Subject: [PATCH] fix some bugs --- scripts/playbook/host-standalone | 2 +- scripts/playbook/multi-machine.yml | 4 ++-- scripts/playbook/roles/pserver/tasks/main,yml | 8 ++++---- scripts/playbook/roles/redis/tasks/main.yml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/playbook/host-standalone b/scripts/playbook/host-standalone index 293ff64d..9ee0aa60 100644 --- a/scripts/playbook/host-standalone +++ b/scripts/playbook/host-standalone @@ -1,2 +1,2 @@ [standalone] -10.41.160.164 \ No newline at end of file +1.1.1.1 \ No newline at end of file diff --git a/scripts/playbook/multi-machine.yml b/scripts/playbook/multi-machine.yml index 61499e95..7f708bc8 100644 --- a/scripts/playbook/multi-machine.yml +++ b/scripts/playbook/multi-machine.yml @@ -32,8 +32,8 @@ password: '{{ mysql_password }}' priv: '*.*:ALL,GRANT' state: present -- name: install mysql for PilotGo platform - hosts: mysql +- name: install pserver PilotGo platform + hosts: pserver become: yes become_user: root diff --git a/scripts/playbook/roles/pserver/tasks/main,yml b/scripts/playbook/roles/pserver/tasks/main,yml index 901ef650..a8f9cf72 100644 --- a/scripts/playbook/roles/pserver/tasks/main,yml +++ b/scripts/playbook/roles/pserver/tasks/main,yml @@ -10,11 +10,11 @@ msg: 'dnf install PilotGo-server failed' when: pilotgo_info.rc != 0 - name: change PilotGo config - shell: sed -i '/^http_server:/,+1 s/0\.0\.0\.0/{{ groups['standalone'][0] }}/' /opt/PilotGo/server/config_server.yaml + shell: sed -i '/^http_server:/,+1 s/0\.0\.0\.0/{{ ansible_default_ipv4['address'] }}/' /opt/PilotGo/server/config_server.yaml - name: change PilotGo config - shell: sed -i '/^socket_server:/,+1 s/0\.0\.0\.0/{{ groups['standalone'][0] }}/' /opt/PilotGo/server/config_server.yaml + shell: sed -i '/^socket_server:/,+1 s/0\.0\.0\.0/{{ ansible_default_ipv4['address'] }}/' /opt/PilotGo/server/config_server.yaml - name: change PilotGo config - shell: sed -i '/^mysql:/,+1 s/localhost/{{ groups['standalone'][0] }}/' /opt/PilotGo/server/config_server.yaml + shell: sed -i '/^mysql:/,+1 s/localhost/{{ ansible_default_ipv4['address'] }}/' /opt/PilotGo/server/config_server.yaml - name: change passwd lineinfile: path: /opt/PilotGo/server/config_server.yaml @@ -22,7 +22,7 @@ line: ' password: {{ mysql_password }}' backrefs: yes - name: change PilotGo config - shell: sed -i '/^redis:/,+1 s/localhost/{{ groups['standalone'][0] }}/' /opt/PilotGo/server/config_server.yaml + shell: sed -i '/^redis:/,+1 s/localhost/{{ ansible_default_ipv4['address'] }}/' /opt/PilotGo/server/config_server.yaml - name: change passwd lineinfile: path: /opt/PilotGo/server/config_server.yaml diff --git a/scripts/playbook/roles/redis/tasks/main.yml b/scripts/playbook/roles/redis/tasks/main.yml index 939dbdd4..d1501239 100644 --- a/scripts/playbook/roles/redis/tasks/main.yml +++ b/scripts/playbook/roles/redis/tasks/main.yml @@ -10,14 +10,14 @@ when: rpm_info.rc == 0 - name: install redis 6 through euler repo dnf: - name: redis6 + name: redis-6* state: present ignore_errors: yes - name: change bind lineinfile: path: /etc/redis/redis.conf regexp: '^#?bind' - line: 'bind {{ groups["standalone"][0] }}' + line: 'bind {{ ansible_default_ipv4['address'] }}' backrefs: yes - name: change daemonize lineinfile: -- Gitee