X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=tasks%2Fconfig_mariadb.yml;h=831fc662c2e32059747a6658f50ec7973f7d270b;hb=HEAD;hp=3816d0cb2f4ffbb7c85d2acc20e3a3292537ec58;hpb=127e62e0da098421ca5cfa85e73648419c9ea17b;p=lhc%2Fansible.git diff --git a/tasks/config_mariadb.yml b/tasks/config_mariadb.yml index 3816d0c..6f1ed97 100644 --- a/tasks/config_mariadb.yml +++ b/tasks/config_mariadb.yml @@ -1,22 +1,32 @@ +- name: Etckeeper commit if necessary + ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ config_ss_domain }}" + ignore_errors: true + +- name: Install ansible mysql required packages + ansible.builtin.apt: + name: + - python3-pymysql + - name: Boucle d'ajout du user php dans plusieurs groupe ansible.builtin.user: - name: "php_{{ SIGLE }}_{{ SITE }}" + name: "php_{{ SIGLE }}_{{ config_ss_domain }}" groups: "{{ item }}" append: true loop: - mysql - - "site_{{ SIGLE }}_{{ SITE }}" + - "site_{{ SIGLE }}_{{ config_ss_domain }}" - name: Création de la nouvelle bdd Mariadb community.mysql.mysql_db: - name: "php_{{ SIGLE }}_{{ SITE }}" + name: "php_{{ SIGLE }}_{{ config_ss_domain }}" state: present login_unix_socket: /run/mysqld/mysqld.sock encoding: utf8mb4 # pour WP - name: Créer le user mysql - mysql_user: - name: "php_{{ SIGLE }}_{{ SITE }}" - priv: "php_{{ SIGLE }}_{{ SITE }}.*:ALL" + community.mysql.mysql_user: + name: "php_{{ SIGLE }}_{{ config_ss_domain }}" + priv: "php_{{ SIGLE }}_{{ config_ss_domain }}.*:ALL" + plugin: unix_socket state: present - login_unix_socket: /run/mysqld/mysqld.sock \ No newline at end of file + login_unix_socket: /run/mysqld/mysqld.sock