Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for group #36

Merged
merged 1 commit into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ roundcube_username_domain: systemli.org
roundcube_product_name: Systemli Webmail
roundcube_support_url: https://www.systemli.org/kontakt.html
roundcube_user: roundcube
roundcube_group: roundcube
roundcube_user_shell: /bin/false
roundcube_user_home: "/var/www/{{ roundcube_domain }}"
roundcube_path: "{{ roundcube_user_home }}/www"
Expand Down
2 changes: 1 addition & 1 deletion tasks/carddav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
src: "plugins/carddav/config.inc.php.j2"
dest: "{{ roundcube_path }}/plugins/carddav/config.inc.php"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: 0640
2 changes: 1 addition & 1 deletion tasks/enigma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
path: "{{ roundcube_enigma_home }}"
state: directory
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: 0700
2 changes: 1 addition & 1 deletion tasks/getmail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
src: plugins/getmail/config.inc.php.j2
dest: "{{ roundcube_path }}/plugins/getmail/config.inc.php"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: 0640
notify: Update database for getmail

Expand Down
14 changes: 12 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
pkg: "cron"
state: present

- name: Ensure roundcube group is present
group:
name: "{{ roundcube_group }}"

- name: Ensure roundcube user is present
user:
name: "{{ roundcube_user }}"
home: "{{ roundcube_user_home }}"
shell: "{{ roundcube_user_shell }}"
groups: "{{ roundcube_group }}"

- name: Install Roundcube dependencies
apt:
Expand Down Expand Up @@ -47,6 +52,8 @@
get_url:
url: "https://github.com/roundcube/roundcubemail/releases/download/{{ roundcube_version }}/roundcubemail-{{ roundcube_version }}-complete.tar.gz"
dest: "{{ roundcube_user_home }}"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: '0440'
when: not ansible_check_mode
register: download
Expand All @@ -56,7 +63,7 @@
src: "{{ roundcube_user_home }}/roundcubemail-{{ roundcube_version }}-complete.tar.gz"
dest: "{{ roundcube_user_home }}"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: 0750
copy: no
when: download.changed
Expand All @@ -65,7 +72,10 @@
file:
src: "{{ roundcube_user_home }}/roundcubemail-{{ roundcube_version }}/"
dest: "{{ roundcube_path }}"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
state: link
follow: False
mode: 0755
register: link
notify: Restart apache
Expand All @@ -75,7 +85,7 @@
src: "{{ item }}.j2"
dest: "{{ roundcube_path }}/{{ item }}"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: 0640
with_items:
- config/config.inc.php
Expand Down
6 changes: 3 additions & 3 deletions tasks/skin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
file:
path: "{{ roundcube_path }}/skins/{{ roundcube_skin }}/"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
recurse: true
when: roundcube_skin == 'elastic_systemli'

Expand All @@ -21,7 +21,7 @@
src: "roundcube/{{ roundcube_custom_logo }}"
dest: "{{ roundcube_path }}/skins/{{ roundcube_skin }}/images/{{ roundcube_custom_logo }}"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: 0644
when: roundcube_custom_logo is defined

Expand All @@ -30,6 +30,6 @@
src: "roundcube/{{ roundcube_custom_favicon }}"
dest: "{{ roundcube_path }}/skins/{{ roundcube_skin }}/images/{{ roundcube_custom_favicon }}"
owner: "{{ roundcube_user }}"
group: "{{ roundcube_user }}"
group: "{{ roundcube_group }}"
mode: 0644
when: roundcube_custom_favicon | default()