diff --git a/scripts/playbook/host-multi-machine b/scripts/playbook/host-multi-machine new file mode 100644 index 0000000000000000000000000000000000000000..c710692eaa972e13bf91278f95477f30f87b1e3e --- /dev/null +++ b/scripts/playbook/host-multi-machine @@ -0,0 +1,8 @@ +[redis] +1.1.1.1 + +[mysql] +2.2.2.2 + +[pserver] +3.3.3.3 \ No newline at end of file diff --git a/scripts/playbook/multi-machine.yml b/scripts/playbook/multi-machine.yml new file mode 100644 index 0000000000000000000000000000000000000000..61499e9572312bc345ae80479efec800ab341c45 --- /dev/null +++ b/scripts/playbook/multi-machine.yml @@ -0,0 +1,41 @@ +--- +- name: install redis for PilotGo platform + hosts: reids + become: yes + become_user: root + + roles: + - redis + tasks: + - name: change protected mode + lineinfile: + path: /etc/redis/redis.conf + regexp: '^#?protected-mode' + line: 'protected-mode no' + backrefs: yes + - name: restart redis service + service: + name: redis + state: restarted +- name: install mysql for PilotGo platform + hosts: mysql + become: yes + become_user: root + + roles: + - mysql + tasks: + - name: Ensure a user can connect from a specific host + mysql_user: + name: root + host: '%' + password: '{{ mysql_password }}' + priv: '*.*:ALL,GRANT' + state: present +- name: install mysql for PilotGo platform + hosts: mysql + become: yes + become_user: root + + roles: + - pserver \ No newline at end of file