diff --git a/scripts/playbook/install_PilotGo.yaml b/scripts/playbook/install_PilotGo.yaml index faaba953ce52bb2949fa7fba8b23d5bf22a232d8..2f383b0cab7d0444c8b0771b48b66c72364db3e0 100644 --- a/scripts/playbook/install_PilotGo.yaml +++ b/scripts/playbook/install_PilotGo.yaml @@ -6,33 +6,9 @@ roles: - redis + - mysql 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 - name: install pilotgo-server dnf: name: PilotGo-server diff --git a/scripts/playbook/roles/mysql/tasks/main.yml b/scripts/playbook/roles/mysql/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..4b6d2f783cac990b2d4638942fe73bc31f68d69b --- /dev/null +++ b/scripts/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