You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.7 KiB

  1. ---
  2. # Copyright (C) 2014-2019 Maciej Delmanowski <drybjed@gmail.com>
  3. # Copyright (C) 2015-2019 DebOps <https://debops.org/>
  4. # SPDX-License-Identifier: GPL-3.0-only
  5. - name: Import DebOps secret role
  6. import_role:
  7. name: 'secret'
  8. - name: Install dbconfig-common
  9. apt: pkg=dbconfig-common state=present install_recommends=no
  10. register: phpmyadmin__register_dbconfig_packages
  11. until: phpmyadmin__register_dbconfig_packages is succeeded
  12. - name: Pre-configure PHPMyAdmin database
  13. template: src=etc/dbconfig-common/phpmyadmin.conf.j2
  14. dest=/etc/dbconfig-common/phpmyadmin.conf
  15. owner=root group=root mode=0600
  16. - name: Install PHPMyAdmin packages
  17. apt: pkg=phpmyadmin state=present install_recommends=no
  18. register: phpmyadmin__register_packages
  19. until: phpmyadmin__register_packages is succeeded
  20. - name: Create database for PHPMyAdmin
  21. mysql_db: name={{ phpmyadmin_control_database | default('phpmyadmin') }} state=present
  22. register: phpmyadmin_database
  23. - name: Import PHPMyAdmin schema
  24. mysql_db: # noqa no-handler
  25. name: '{{ phpmyadmin_control_database | default("phpmyadmin") }}'
  26. state: 'import'
  27. target: '/usr/share/dbconfig-common/data/phpmyadmin/install/mysql'
  28. login_unix_socket: '/run/mysqld/mysqld.sock'
  29. when: phpmyadmin_database is defined and phpmyadmin_database is changed
  30. - name: Create PHPMyAdmin control user
  31. mysql_user:
  32. name: "{{ phpmyadmin_control_user | default('phpmyadmin') }}"
  33. state: 'present'
  34. password: '{{ phpmyadmin_control_password }}'
  35. priv: "{{ phpmyadmin_control_database | default('phpmyadmin') }}.*:ALL"
  36. login_unix_socket: '/run/mysqld/mysqld.sock'
  37. no_log: '{{ debops__no_log | d(True) }}'