diff --git a/playbook/host-multi-machine b/playbook/host-multi-machine new file mode 100644 index 0000000000000000000000000000000000000000..6ef00266dd9393a0a9bf3c5f6059e2f6f3493227 --- /dev/null +++ b/playbook/host-multi-machine @@ -0,0 +1,11 @@ +[mysql] +1.1.1.1 + +[redis] +2.2.2.2 + +[pilotgo] +3.3.3.3 + +[topo] +4.4.4.4 diff --git a/playbook/host-standalone b/playbook/host-standalone deleted file mode 100644 index 9ee0aa60706de3d471da5c6324b30003bd1567fc..0000000000000000000000000000000000000000 --- a/playbook/host-standalone +++ /dev/null @@ -1,2 +0,0 @@ -[standalone] -1.1.1.1 \ No newline at end of file diff --git a/playbook/multi-machine.yml b/playbook/multi-machine.yml new file mode 100644 index 0000000000000000000000000000000000000000..d9fca0f2b766cf61c4201aa5a3e69e8841ba5b54 --- /dev/null +++ b/playbook/multi-machine.yml @@ -0,0 +1,16 @@ +--- +- 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 diff --git a/playbook/roles/mysql/tasks/main.yml b/playbook/roles/mysql/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..4b6d2f783cac990b2d4638942fe73bc31f68d69b --- /dev/null +++ b/playbook/roles/mysql/tasks/main.yml @@ -0,0 +1,26 @@ +--- +- name: install mysql through euler repo + dnf: + name: "{{ item }}" + state: present + with_items: + - mysql-server + - python3-pexpect + ignore_errors: yes +- name: start mysql + service: + name: mysqld + state: restarted +- name: change passwd + expect: + command: mysqladmin -u root -p password '{{ mysql_password }}' + responses: + (?i)password: "\n" + vars: + ansible_python_interpreter: /usr/bin/python3 + register: info + ignore_errors: yes +- name: change passwd + debug: + msg: '{{ info.stdout_lines }} mysql already has password' + when: info.rc != 0 \ No newline at end of file diff --git a/playbook/roles/pilotgo/tasks/main.yml b/playbook/roles/pilotgo/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/playbook/roles/redis/tasks/main.yml b/playbook/roles/redis/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/playbook/roles/topo/tasks/main.yml b/playbook/roles/topo/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/playbook/standalone.yml b/playbook/standalone.yml deleted file mode 100644 index 37dca1ce59c0ec9496f3e336bc3e864eb0f911a7..0000000000000000000000000000000000000000 --- a/playbook/standalone.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: install pilotgo & topo plugin standlone - hosts: standalone - remote_user: root - - tasks: - - name: install mysql through euler repo - dnf: - name: "{{ item }}" - state: present - with_items: - - mysql-server - - python3-pexpect - ignore_errors: yes - - name: start mysql - service: - name: mysqld - state: restarted - - name: change passwd - expect: - command: mysqladmin -u root -p password '{{ mysql_password }}' - responses: - (?i)password: "\n" - vars: - ansible_python_interpreter: /usr/bin/python3 - register: info - ignore_errors: yes - - name: change passwd - debug: - msg: '{{ info.stdout_lines }} mysql already has password' - when: info.rc != 0