Commit 700c2c23 authored by Okhin's avatar Okhin

Amélioration des taches wordpress

parent 1e7e34f2
--- ---
- block: - name: ajout d'un répertoire pour le core wordpress
- name: ajout d'un répertoire pour le core wordpress file:
file: state: directory
status: directory path: "{{ wordpress_path }}"
src: "{{ wordpress_path }}" mode: 0755
mode: 0755 owner: "{{ wordpress_unix_user }}"
owner: "{{ wordpress_unix_user }}" group: "{{ webserver_user }}"
group: "{{ webserver_user }} "
# This is vault-encrypted, but not SQL encrypted
- name: ajout d'un utilisateur mysql pour wordpress
mysql_user:
name: "{{ wordpress_dbuser }}"
host: localhost
state: present
password: "{{ wordpress_dbpass }}"
priv: '*.*:CREATE'
- block:
# We want to always check that, in order to test other commands
# And we cannot fail (the purpose of this command is to fail if wp isn't installed, to trigger
# a change later
- name: est-ce que wordpress est installé ? - name: est-ce que wordpress est installé ?
command: "php {{ wordpress_wpcli_path }} core is-installed --path={{ wordpress_path }}" command: "php {{ wordpress_wpcli_path }} core is-installed --path={{ wordpress_path }}"
register: wordpress register: wordpress
changed_when: "wordpress.rc >= 1" changed_when: "wordpress.rc >= 1"
failed_when: False
check_mode: no
- name: téléchargement de wordpress - name: téléchargement de wordpress
command: "php {{ wordpress_wpcli_path }} core download --path={{ wordpress_path }}" command: "php {{ wordpress_wpcli_path }} core download --path={{ wordpress_path }}"
args:
creates: "{{ wordpress_path }}/index.php"
when: wordpress.changed when: wordpress.changed
- name: installation de worpdress - name: configuration de wordpress
command: "php {{ wordpress_wpcli_path }} config create --path={{ wordpress_path }} --dbuser={{ wordpress_dbuser }} --dbname={{ wordpress_dbname }} --dbpass={{ wordpress_dbpass }}"
when: wordpress.changed
args:
creates: "{{ wordpress_path }}/wp_config.php"
- 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
...@@ -26,6 +48,6 @@ ...@@ -26,6 +48,6 @@
- name: mise à jour de la BDD de wordpress - name: mise à jour de la BDD de wordpress
command: "php {{ wordpress_wpcli_path }} core update-db --network --path={{ wordpress_path }}" command: "php {{ wordpress_wpcli_path }} core update-db --network --path={{ wordpress_path }}"
become: yes become: yes
become_user: grange become_user: "{{ wordpress_unix_user }}"
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