diff --git a/playbook/multi-machine.yml b/playbook/multi-machine.yml index e24e2889ef1fa8b4b96803fbee1d6fa8fd552d55..adf0891c18d87ef4ecd9d859270d03b97e2ed30d 100644 --- a/playbook/multi-machine.yml +++ b/playbook/multi-machine.yml @@ -31,4 +31,11 @@ - name: restart redis service service: name: redis - state: restarted \ No newline at end of file + state: restarted +- name: install pserver PilotGo platform + hosts: pilotgo + become: yes + become_user: root + + roles: + - pilotgo \ No newline at end of file diff --git a/playbook/roles/pilotgo/tasks/main.yml b/playbook/roles/pilotgo/tasks/main.yml index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..901ef6507ec3eb5915ece0fa16649ca7ff59f78e 100644 --- a/playbook/roles/pilotgo/tasks/main.yml +++ b/playbook/roles/pilotgo/tasks/main.yml @@ -0,0 +1,31 @@ +--- +- name: install pilotgo-server + dnf: + name: PilotGo-server + state: present + register: pilotgo_info + ignore_errors: yes +- name: exit when pilotgo-server fail install + fail: + 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 +- name: change PilotGo config + shell: sed -i '/^socket_server:/,+1 s/0\.0\.0\.0/{{ groups['standalone'][0] }}/' /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 +- name: change passwd + lineinfile: + path: /opt/PilotGo/server/config_server.yaml + regexp: '^#?password' + 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 +- name: change passwd + lineinfile: + path: /opt/PilotGo/server/config_server.yaml + regexp: '^#?redis_pwd' + line: ' redis_pwd: {{ redis_password }}' + backrefs: yes \ No newline at end of file