✨: introduce webapps playbook to handle web php applications
This commit is contained in:
15
roles/roundcube/tasks/db.yml
Normal file
15
roles/roundcube/tasks/db.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Create roundcube db role
|
||||
become_user: postgres
|
||||
become: true
|
||||
community.postgresql.postgresql_user:
|
||||
name: "{{ roundcube_pg_role }}"
|
||||
password: "{{ roundcube_pg_password }}"
|
||||
|
||||
- name: Create roundcube db
|
||||
become_user: postgres
|
||||
become: true
|
||||
community.postgresql.postgresql_db:
|
||||
name: "{{ roundcube_pg_database }}"
|
||||
owner: "{{ roundcube_pg_role }}"
|
10
roles/roundcube/tasks/main.yml
Normal file
10
roles/roundcube/tasks/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Init DB
|
||||
ansible.builtin.include_tasks: db.yml
|
||||
|
||||
- name: Install roundcube
|
||||
ansible.builtin.include_tasks: roundcube.yml
|
||||
|
||||
- name: Install roundcube carddav plugin
|
||||
ansible.builtin.include_tasks: roundcube_carddav.yml
|
41
roles/roundcube/tasks/roundcube.yml
Normal file
41
roles/roundcube/tasks/roundcube.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
|
||||
- name: Create application directory
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
dest: "{{ roundcube_local_path }}"
|
||||
owner: "root"
|
||||
group: "www-data"
|
||||
mode: "0o750"
|
||||
|
||||
- name: Unzip roundcube
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: true
|
||||
src: "{{ roundcube_url }}"
|
||||
dest: "{{ roundcube_local_path }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
extra_opts: ['--strip-components=1']
|
||||
exclude:
|
||||
- "{{ roundcube_config_path }}"
|
||||
|
||||
- name: Put roundcube configuration
|
||||
ansible.builtin.template:
|
||||
src: "config.inc.php.j2"
|
||||
dest: "{{ roundcube_config_path }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "0o640"
|
||||
|
||||
- name: Check writable dir
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
recurse: true
|
||||
dest: "{{ roundcube_local_path }}/{{ item }}"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "g+w"
|
||||
loop:
|
||||
- "logs"
|
||||
- "temp"
|
18
roles/roundcube/tasks/roundcube_carddav.yml
Normal file
18
roles/roundcube/tasks/roundcube_carddav.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
|
||||
- name: Unzip carddav plugin
|
||||
ansible.builtin.unarchive:
|
||||
remote_src: true
|
||||
src: "{{ roundcube_carddav_url }}"
|
||||
dest: "{{ roundcube_local_path }}/plugins"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "a-rwx,u+rwX,g+rX"
|
||||
|
||||
- name: Put carddav config file
|
||||
ansible.builtin.template:
|
||||
src: "carddav.config.inc.php.j2"
|
||||
dest: "{{ roundcube_local_path }}/plugins/carddav/config.inc.php"
|
||||
owner: root
|
||||
group: www-data
|
||||
mode: "0o640"
|
Reference in New Issue
Block a user