2021-10-24 15:02:07 +02:00
|
|
|
---
|
|
|
|
|
2022-06-21 21:13:44 +02:00
|
|
|
- name: "[CARDDAV] - Creating writing directory for Composer"
|
2021-10-28 08:54:56 +02:00
|
|
|
file:
|
2022-06-21 21:13:44 +02:00
|
|
|
dest: /var/www/.config/composer/
|
2021-10-28 08:54:56 +02:00
|
|
|
recurse: yes
|
|
|
|
owner: "{{ rcube_app_username }}"
|
|
|
|
group: "{{ rcube_app_group }}"
|
|
|
|
state: directory
|
|
|
|
|
2022-06-21 21:13:44 +02:00
|
|
|
- name: "[CARDDAV] - Install low-level utilities"
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- zip
|
|
|
|
- unzip
|
|
|
|
state: present
|
|
|
|
|
2021-10-24 15:02:07 +02:00
|
|
|
- name: "[CARDDAV] - Install Composer from script"
|
|
|
|
script:
|
|
|
|
cmd: install_composer.sh
|
|
|
|
chdir: "{{ rcube_latest_path }}"
|
2021-10-28 08:54:56 +02:00
|
|
|
become_user: '{{ rcube_app_username }}'
|
2021-10-24 15:02:07 +02:00
|
|
|
|
2022-06-21 21:13:44 +02:00
|
|
|
- name: "[CARDDAV] - Update composer and related modules"
|
|
|
|
shell:
|
|
|
|
cmd: "yes | php{{ php_version }} composer.phar update --no-dev"
|
|
|
|
chdir: '{{ rcube_latest_path }}'
|
|
|
|
become: yes
|
|
|
|
become_user: '{{ rcube_app_username }}'
|
|
|
|
|
2021-10-24 15:02:07 +02:00
|
|
|
- name: "[CARDDAV] - Deploy composer.json file"
|
|
|
|
template:
|
|
|
|
src: "composer.json.j2"
|
|
|
|
dest: "{{ rcube_latest_path }}/composer.json"
|
|
|
|
mode: 0644
|
|
|
|
owner: "{{ rcube_app_username }}"
|
|
|
|
group: "{{ rcube_app_group }}"
|
|
|
|
|
|
|
|
- name: "[CARDDAV] - Install / Update carddav with Composer"
|
|
|
|
shell:
|
2021-10-28 08:54:56 +02:00
|
|
|
cmd: "yes | php{{ php_version }} composer.phar require --update-no-dev roundcube/carddav"
|
2021-10-24 15:02:07 +02:00
|
|
|
chdir: "{{ rcube_latest_path }}"
|
2022-06-21 21:13:44 +02:00
|
|
|
become: yes
|
2021-10-24 15:02:07 +02:00
|
|
|
become_user: '{{ rcube_app_username }}'
|
|
|
|
|
|
|
|
- name: "[CARDDAV] - Install carddav configuration file"
|
|
|
|
template:
|
|
|
|
src: "plugins/carddav/config.inc.php.j2"
|
|
|
|
dest: "{{ rcube_latest_path }}/plugins/carddav/config.inc.php"
|
|
|
|
mode: 0644
|
|
|
|
owner: "{{ rcube_app_username }}"
|
|
|
|
group: "{{ rcube_app_group }}"
|
|
|
|
|
|
|
|
- name: "[CARDDAV] - Carddav is in config file?"
|
|
|
|
shell:
|
|
|
|
cmd: "grep carddav {{ rcube_latest_path }}/config/config.inc.php ; echo $?"
|
|
|
|
register: carddav_in_config
|
|
|
|
|
|
|
|
- name: "[CARDDAV] - Add carddav in config.inc.php"
|
|
|
|
lineinfile:
|
|
|
|
path: "{{ rcube_latest_path }}/config/config.inc.php"
|
2022-07-29 11:30:12 +02:00
|
|
|
insertafter: "^.{1}config.{2}plugins.*$"
|
2021-10-24 15:02:07 +02:00
|
|
|
line: "'carddav',"
|
|
|
|
state: present
|
|
|
|
when: carddav_in_config.stdout == "1"
|
|
|
|
|
2022-06-21 21:13:44 +02:00
|
|
|
# - name: "[CARDDAV] - Is twofactor_gauthenticator in config file?"
|
|
|
|
# shell:
|
|
|
|
# cmd: "grep twofactor {{ rcube_latest_path }}/config/config.inc.php 1>/dev/null ; echo $?"
|
|
|
|
# register: twofactor_gauthenticator_in_config
|
|
|
|
#
|
|
|
|
# - name: "[CARDDAV] - Remove the twofactor_gauthenticator plugin line"
|
|
|
|
# lineinfile:
|
|
|
|
# path: "{{ rcube_latest_path }}/config/config.inc.php"
|
|
|
|
# regexp: "^.*'twofactor_gauthenticator',"
|
|
|
|
# state: absent
|
|
|
|
# when: twofactor_gauthenticator_in_config.stdout == "0"
|
|
|
|
#
|
|
|
|
# - name: "[CARDDAV] - Set the twofactor_gauthenticator plugin after carddav"
|
|
|
|
# lineinfile:
|
|
|
|
# path: "{{ rcube_latest_path }}/config/config.inc.php"
|
|
|
|
# insertafter: "'carddav',"
|
|
|
|
# line: "'twofactor_gauthenticator',"
|
|
|
|
# state: present
|
|
|
|
# when: twofactor_gauthenticator_in_config.stdout == "0"
|