roundcube: First draft of role

This commit is contained in:
Timo Makinen 2023-02-04 18:17:42 +00:00
parent 9a988bf637
commit 42cb1c86c9
7 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,72 @@
---
- name: Create group
ansible.builtin.group:
name: roundcube
- name: Create user
ansible.builtin.user:
name: roundcube
comment: Podman Roundcube
group: roundcube
shell: /sbin/nologin
- name: Copy host key
ansible.builtin.copy:
dest: "{{ tls_private }}/roundcube.key"
src: "{{ tls_private }}/{{ inventory_hostname }}.key"
mode: 0640
owner: root
group: roundcube
remote_src: true
- name: Create config directory
ansible.builtin.file:
path: /etc/roundcube
state: directory
mode: 0755
owner: root
group: "{{ ansible_wheel }}"
- name: Create local configuration
ansible.builtin.template:
dest: /etc/roundcube/local.php
src: local.php.j2
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
- name: Create service config
ansible.builtin.template:
dest: /etc/sysconfig/roundcube-container
src: roundcube-container.sysconfig.j2
mode: 0600
owner: root
group: "{{ ansible_wheel }}"
notify: Restart roundcube
- name: Create service file
ansible.builtin.template:
dest: /etc/systemd/system/roundcube-container.service
src: roundcube-container.service.j2
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
notify: Restart roundcube
- name: Enable service
ansible.builtin.service:
name: roundcube-container
state: started
enabled: true
- name: Copy nginx config
ansible.builtin.copy:
dest: /etc/nginx/conf.d/{{ inventory_hostname }}/roundcube-container.conf
content: |
location /roundcube/ {
proxy_pass http://localhost:8004/;
}
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
notify: Restart nginx