~nka/ansible-role-roundcube

060b3b5692e07e90ca2e197a7acd60c1a4e86606 — Nicolas KAROLAK 2 months ago 6ecaed3 v1.0.0
add database creation
2 files changed, 42 insertions(+), 0 deletions(-)

M defaults/main.yml
M tasks/main.yml
M defaults/main.yml => defaults/main.yml +9 -0
@@ 1,5 1,7 @@
---

rc_ansible_packages:
  - python3-psycopg2
rc_apache_mods:
  - 'deflate'
  - 'expires'


@@ 11,6 13,13 @@ rc_apache_remoteip: |
  RemoteIPTrustedProxy {{ proxy }}
  {% endfor %}
rc_app_path: '/var/www/roundcubemail'
rc_db_admin: postgres
rc_db_admin_password:
rc_db_host: localhost
rc_db_name: roundcubemail
rc_db_port: 5432
rc_db_user: roundcube
rc_db_user_password:
rc_domains:
  - mail.example.net
rc_packages:

M tasks/main.yml => tasks/main.yml +33 -0
@@ 1,5 1,13 @@
---

# SYSTEM

- name: install ansible requirements
  apt:
    force_apt_get: true
    install_recommends: false
    name: "{{ rc_ansible_packages }}"

- name: 'install packages'
  notify: 'restart apache'
  apt:


@@ 7,6 15,31 @@
    install_recommends: false
    name: '{{ rc_packages }}'

# DATABASE

- name: create database user
  no_log: true
  postgresql_user:
    login_host: "{{ rc_db_host }}"
    login_port: "{{ rc_db_port }}"
    login_user: "{{ rc_db_admin }}"
    login_password: "{{ rc_db_admin_password }}"
    name: "{{ rc_db_user }}"
    password: "{{ rc_db_user_password }}"

- name: create database
  no_log: true
  register: rc_db_create
  postgresql_db:
    login_host: "{{ rc_db_host }}"
    login_port: "{{ rc_db_port }}"
    login_user: "{{ rc_db_admin }}"
    login_password: "{{ rc_db_admin_password }}"
    name: "{{ rc_db_name }}"
    owner: "{{ rc_db_user }}"

# ROUNDCUBE

- name: 'download archive'
  register: 'rc_download'
  get_url: