config.yml 567 B

12345678910111213141516171819202122232425
  1. ---
  2. - name: Get MySQL version.
  3. command: 'mysql --version'
  4. register: mysql_cli_version
  5. changed_when: false
  6. check_mode: false
  7. - name: Read SQL configuration
  8. set_fact:
  9. sql_content: "{{ lookup('template', '{{ role_path }}/templates/sql.j2') }}"
  10. no_log: true
  11. - name: Integration SQL configuration
  12. copy:
  13. dest: /tmp/file.sql
  14. content: '{{ sql_content }}'
  15. - name: Set ProxySQL admin config
  16. shell: "mysql -u admin -padmin -h 127.0.0.1 -P 6032 < /tmp/file.sql"
  17. no_log: true
  18. - name: Remove file
  19. file:
  20. path: /tmp/file.sql
  21. state: absent