1 - name: Etckeeper commit if necessary
2 ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ config_ss_domain }}"
4 - name: Install required packages
18 - name: Enable PHP modules
19 ansible.builtin.command: phpenmod sqlite3 imagick intl
20 when: php_install.changed
22 - name: Bloc paheko_version
23 when: paheko_version is undefined
25 - name: Demande la version de paheko à installer
26 ansible.builtin.pause:
27 prompt: "Quelle version de paheko doit être utilisé"
29 register: paheko_version_prompt
31 - name: Definir paheko_version
32 ansible.builtin.set_fact:
33 paheko_version: "{{ paheko_version_prompt.user_input }}"
35 - name: Vérif si la source paheko est téléchargée
38 path: "/home/sites/data/paheko/{{ paheko_version }}"
39 register: paheko_source_path
41 - name: Installion de la nouvelle version paheko
42 when: not paheko_source_path.stat.exists
45 - name: Boucle création ou modifications des répertoires pahéko
47 path: "{{ item.path }}"
48 state: "{{ item.state }}"
49 owner: "{{ item.owner }}"
50 group: "{{ item.group }}"
51 mode: "{{ item.mode }}"
53 label: "{{ item.path }}"
55 - path: "/home/sites/data/paheko/{{ paheko_version }}"
61 - name: Telecharger la source Paheko
64 ansible.builtin.get_url:
65 url: "https://fossil.kd2.org/paheko/uv/paheko-{{ paheko_version }}.tar.gz"
66 dest: "/home/sites/data/paheko/{{ paheko_version }}.tar.gz"
67 mode: '755' # or u=rwx,g=rx,o=rx
69 - name: Extract downloaded paheko source
72 ansible.builtin.unarchive:
73 src: "/home/sites/data/paheko/{{ paheko_version }}.tar.gz"
74 dest: "/home/sites/data/paheko"
75 # mode: '755' # or u=rwx,g=rx,o=rx
78 - name: Renommer paheko-version par uniquement la version
82 src: "/home/sites/data/paheko/paheko-{{ paheko_version }}/"
83 dest: "/home/sites/data/paheko/{{ paheko_version }}"
84 remote_src: true # because the config file is already on the paheko path
87 - name: Deleted downloaded paheko files
93 - "/home/sites/data/paheko/{{ paheko_version }}.tar.gz"
94 - "/home/sites/data/paheko/paheko-{{ paheko_version }}"
96 - name: Copie la source paheko vers le home du site
98 # become_user: "php_{{ SIGLE }}_{{ config_ss_domain }}"
100 src: "/home/sites/data/paheko/{{ paheko_version }}/"
101 dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
102 remote_src: true # because the config file is already in the nextcloud_tmp_path
105 - name: Modification du propriétaire group et droits du dossier
106 ansible.builtin.file:
107 path: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/"
109 owner: "php_{{ SIGLE }}_{{ config_ss_domain }}"
110 group: "site_{{ SIGLE }}_{{ config_ss_domain }}"
114 # - name: Change displayed icon
115 # ansible.builtin.copy:
117 # dest: "/usr/share/garradin/www/admin/static/icon{{ icon | splitext | last }}"
118 # when: icon is defined
120 # - name: Change page favicon
121 # ansible.builtin.copy:
122 # src: "{{ favicon }}"
123 # dest: "/usr/share/garradin/www/admin/static/favicon{{ icon | splitext | last }}"
124 # when: favicon is defined
126 - name: Recharger PHP et nginx
127 ansible.builtin.service:
131 - "php{{ php_version }}-fpm"