✨: move phpbb to app dir
Some checks failed
ansible-lint / lint-everything (push) Failing after 1m35s
Some checks failed
ansible-lint / lint-everything (push) Failing after 1m35s
This commit is contained in:
77
roles/phpbb/tasks/phpbb.yml
Normal file
77
roles/phpbb/tasks/phpbb.yml
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
|
||||
- name: Remove phpbb previous version
|
||||
ansible.builtin.file:
|
||||
state: absent
|
||||
dest: "{{ phpbb_app_home }}"
|
||||
|
||||
## Handle app data
|
||||
- name: Create app home
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
dest: "{{ phpbb_app_home }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "0o750"
|
||||
|
||||
- name: Install phpbb application
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: true
|
||||
src: "{{ phpbb_url }}"
|
||||
dest: "{{ phpbb_app_home }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
extra_opts: ['--strip-components=1']
|
||||
exclude: "{{ phpbb_userdata_app_dirs | map('regex_replace', '^^', 'phpBB' ~ phpbb_major_version ~ '/') }}"
|
||||
|
||||
- name: Check writable dirs
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
dest: "{{ phpbb_app_home }}/{{ item }}"
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
recurse: true
|
||||
loop: "{{ phpbb_writable_app_dirs }}"
|
||||
|
||||
## Handle user data
|
||||
- name: Create data home
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{{ phpbb_data_home }}"
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
|
||||
- name: Get data dir
|
||||
ansible.builtin.stat:
|
||||
path: "{{ phpbb_data_home }}/{{ phpbb_userdata_app_dirs[0] }}"
|
||||
register: _phpbb_userdata_dir_stat
|
||||
|
||||
- name: Install phpbb data dir
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: true
|
||||
src: "{{ phpbb_url }}"
|
||||
dest: "{{ phpbb_data_home }}"
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
extra_opts: ['--strip-components=1']
|
||||
include: "{{ phpbb_userdata_app_dirs | map('regex_replace', '^^', 'phpBB' ~ phpbb_major_version ~ '/') }}"
|
||||
when: not _phpbb_userdata_dir_stat.stat.exists
|
||||
|
||||
- name: Link phpbb userdata dirs
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
src: "{{ phpbb_data_home }}/{{ item }}"
|
||||
dest: "{{ phpbb_app_home }}/{{ item }}"
|
||||
loop: "{{ phpbb_userdata_app_dirs }}"
|
||||
|
||||
- name: Put phpbb config file
|
||||
ansible.builtin.template:
|
||||
src: config.php.j2
|
||||
dest: "{{ phpbb_app_home }}/config.php"
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: "0o640"
|
Reference in New Issue
Block a user