Commit 1d51f21b authored by Okhin's avatar Okhin

Fixing the tasks for wordpress multisite install

parent 700c2c23
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
owner: "{{ wordpress_unix_user }}" owner: "{{ wordpress_unix_user }}"
group: "{{ webserver_user }}" group: "{{ webserver_user }}"
- name: création de la base de données pour wordpress
mysql_db:
name: "{{ wordpress_dbname }}"
state: present
# This is vault-encrypted, but not SQL encrypted # This is vault-encrypted, but not SQL encrypted
- name: ajout d'un utilisateur mysql pour wordpress - name: ajout d'un utilisateur mysql pour wordpress
mysql_user: mysql_user:
...@@ -14,7 +19,8 @@ ...@@ -14,7 +19,8 @@
host: localhost host: localhost
state: present state: present
password: "{{ wordpress_dbpass }}" password: "{{ wordpress_dbpass }}"
priv: '*.*:CREATE' priv: "{{ wordpress_dbname }}.*:ALL/*.*:USAGE"
append_privs: true
- block: - block:
# We want to always check that, in order to test other commands # We want to always check that, in order to test other commands
...@@ -34,13 +40,13 @@ ...@@ -34,13 +40,13 @@
when: wordpress.changed when: wordpress.changed
- name: configuration de wordpress - name: configuration de wordpress
command: "php {{ wordpress_wpcli_path }} config create --path={{ wordpress_path }} --dbuser={{ wordpress_dbuser }} --dbname={{ wordpress_dbname }} --dbpass={{ wordpress_dbpass }}" command: "php {{ wordpress_wpcli_path }} config create --path={{ wordpress_path }} --dbuser={{ wordpress_dbuser }} --dbname={{ wordpress_dbname }} --dbpass='{{ wordpress_dbpass }}' --dbhost=localhost"
when: wordpress.changed when: wordpress.changed
args: args:
creates: "{{ wordpress_path }}/wp_config.php" creates: "{{ wordpress_path }}/wp-config.php"
- name: installation multisite de worpdress - name: installation multisite de worpdress
command: "php {{ wordpress_wpcli_path }} core multisite-install --subdomains --path={{ wordpress_path }} --url={{ wordpress_url }} --title={{ wordpress_title }} --admin_user={{ wordpress_admin_user }} --admin-email={{ wordpress_admin_email }}" command: "php {{ wordpress_wpcli_path }} core multisite-install --subdomains --path={{ wordpress_path }} --url={{ wordpress_url }} --title='{{ wordpress_title }}' --admin_user={{ wordpress_admin_user }} --admin_email={{ wordpress_admin_email }}"
when: wordpress.changed when: wordpress.changed
- name: mise à jour de wordpress - name: mise à jour de wordpress
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment