c328bc00ea7f5c87dc690776c854473fc5476b2c
[lhc/ansible.git] / tasks / config_WP.yml
1
2 - name: Create new app common folder from old version one
3 become_user: "site_{{ SIGLE }}_{{ SITE }}"
4 become: true
5 ansible.builtin.copy:
6 src: "/home/sites/data/wordpress"
7 dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/"
8 remote_src: true # because the copy is from remote host to remote host
9 mode: '754' # or 'u=rwx,g=rx,o=r'
10
11 - name: Créer les fichiers spécifiques wp
12 ansible.builtin.template:
13 src: "templates/{{ item.src }}"
14 dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/{{ item.dest }}"
15 owner: "{{ item.owner }}"
16 group: "{{ item.group }}"
17 mode: "{{ item.mode }}"
18 loop:
19 - src: "wp-config.php.j2"
20 dest: "wp-config.php"
21 owner: "php_{{ SIGLE }}_{{ SITE }}"
22 group: "site_{{ SIGLE }}_{{ SITE }}"
23 mode: '640'
24
25 - name: Recharger PHP et nginx
26 ansible.builtin.service:
27 name: "{{ item }}"
28 state: reloaded
29 loop:
30 - "php{{ php_version }}-fpm"
31 - "nginx"