From 940be65acbe535c57c4fcef8da7a654761f291b2 Mon Sep 17 00:00:00 2001 From: Victor LABORIE Date: Fri, 27 Oct 2017 17:59:15 +0200 Subject: [PATCH] roundcube: merge imapproxy role into roundcube --- imapproxy/tasks/main.yml | 15 --------------- webapps/roundcube/defaults/main.yml | 2 ++ webapps/roundcube/handlers/main.yml | 5 +++++ webapps/roundcube/meta/main.yml | 3 --- webapps/roundcube/tasks/main.yml | 27 +++++++++++++++++++++++++++ 5 files changed, 34 insertions(+), 18 deletions(-) delete mode 100644 imapproxy/tasks/main.yml create mode 100644 webapps/roundcube/handlers/main.yml delete mode 100644 webapps/roundcube/meta/main.yml diff --git a/imapproxy/tasks/main.yml b/imapproxy/tasks/main.yml deleted file mode 100644 index 0dc62a60..00000000 --- a/imapproxy/tasks/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: install imapproxy - apt: - name: imapproxy - state: present - tags: - - imapproxy - -- name: enable imapproxy - service: - name: imapproxy - state: started - enabled: True - tags: - - imapproxy diff --git a/webapps/roundcube/defaults/main.yml b/webapps/roundcube/defaults/main.yml index 220720e3..5e0c1a81 100644 --- a/webapps/roundcube/defaults/main.yml +++ b/webapps/roundcube/defaults/main.yml @@ -1,2 +1,4 @@ --- roundcube_host: "roundcube.{{ ansible_fqdn }}" +roundcube_imap_host: "localhost" +roundcube_imap_port: 143 diff --git a/webapps/roundcube/handlers/main.yml b/webapps/roundcube/handlers/main.yml new file mode 100644 index 00000000..bdba6e6b --- /dev/null +++ b/webapps/roundcube/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart imapproxy + systemd: + name: imapproxy + state: restarted diff --git a/webapps/roundcube/meta/main.yml b/webapps/roundcube/meta/main.yml deleted file mode 100644 index ddd0e27c..00000000 --- a/webapps/roundcube/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - { role: imapproxy } diff --git a/webapps/roundcube/tasks/main.yml b/webapps/roundcube/tasks/main.yml index 474fffb0..37ef1afe 100644 --- a/webapps/roundcube/tasks/main.yml +++ b/webapps/roundcube/tasks/main.yml @@ -16,6 +16,7 @@ name: "{{ item }}" state: present with_items: + - imapproxy - roundcube - roundcube-sqlite3 - roundcube-plugins @@ -24,6 +25,32 @@ tags: - roundcube +- name: configure imapproxy imap host + lineinfile: + dest: /etc/imapproxy.conf + regexp: "^server_hostname" + line: "server_hostname {{ roundcube_imap_host }}" + notify: restart imapproxy + tags: + - roundcube + +- name: configure imapproxy imap port + lineinfile: + dest: /etc/imapproxy.conf + regexp: "^server_port" + line: "server_port {{ roundcube_imap_port }}" + notify: reload imapproxy + tags: + - roundcube + +- name: enable and start imapproxy + service: + name: imapproxy + state: started + enabled: True + tags: + - roundcube + - name: configure roundcube imap host lineinfile: dest: /etc/roundcube/config.inc.php