ansible-role-sogo/tasks/main.yml

162 lines
3.3 KiB
YAML
Raw Normal View History

2021-05-14 14:20:55 +02:00
---
# vim: set expandtab tabstop=2 shiftwidth=2:
- name: '[sogo] install gnutls, sogo, deps...'
apt:
name:
- gnutls-bin
- postgresql-client
2022-12-01 14:13:22 +01:00
- python3-psycopg2
- python3-passlib
- python3-openssl
2021-05-14 14:20:55 +02:00
- memcached
- gnustep-base-common
- gnustep-base-runtime
- gobjc
- libldap-common
- libxml2-dev
- libytnef-dev
2021-05-14 14:20:55 +02:00
- tzdata
- zlib1g
- build-essential
- cdbs
- curl
- debhelper
- gcc
- git
- gnustep-make
- libgnustep-base-dev
- libcurl4-openssl-dev
- libldap2-dev
- liblasso3-dev
- liboath-dev
2021-05-14 14:20:55 +02:00
- libmemcached-dev
- libsodium-dev
- libssl-dev
- make
- postgresql-server-dev-all
2022-12-01 14:13:22 +01:00
- python3
- python-is-python3
2021-05-14 14:20:55 +02:00
- libzip-dev
- name: '[sogo] sope-git'
git:
repo: https://github.com/inverse-inc/sope
dest: /root/develop/sope
version: '{{sope_checkout}}'
- name: '[sogo] sogo-git'
git:
repo: https://github.com/inverse-inc/sogo
dest: /root/develop/sogo
version: '{{sogo_checkout}}'
- name: '[sogo] configure sope'
shell: |
./configure --disable-debug --enable-strip --with-gnustep --disable-mysql --enable-openldap --enable-postgresql --enable-xml --with-ssl=gnutls
args:
chdir: /root/develop/sope
- name: '[sogo] make sope'
shell: make
args:
chdir: /root/develop/sope
- name: '[sogo] install sope'
shell: make install
args:
chdir: /root/develop/sope
- name: '[sogo] configure sogo'
shell: |
./configure --disable-debug --enable-strip --enable-saml2 --enable-mfa --with-ssl=gnutls
2021-05-14 14:20:55 +02:00
args:
chdir: /root/develop/sogo
- name: '[sogo] make sogo'
shell: make
args:
chdir: /root/develop/sogo
- name: '[sogo] install sogo'
shell: make install
args:
chdir: /root/develop/sogo
- name: '[sogo] ld.so.conf.d/sogo'
copy:
dest: /etc/ld.so.conf.d/sogo.conf
content: /usr/local/lib/sogo
- name: '[sogo] ldconfig'
shell: ldconfig
- name: '[sogo] create db sogo'
become: yes
become_user: postgres
delegate_to: '{{postgresql_server}}'
run_once: yes
postgresql_db:
name: sogo
encoding: UTF-8
template: template0
- name: '[sogo] create db-user sogo'
become: yes
become_user: postgres
delegate_to: '{{postgresql_server}}'
run_once: yes
postgresql_user:
db: sogo
name: sogo
encrypted: yes
password: '{{postgresql_user_password | default("sogo")}}'
- name: '[sogo] group sogo'
group:
name: sogo
- name: '[sogo] user sogo'
user:
name: sogo
group: sogo
- name: '[sogo] directory /etc/sogo'
file:
state: directory
dest: /etc/sogo
owner: sogo
group: sogo
mode: 0700
- name: '[sogo] sogo.conf'
template:
src: sogo.conf.j2
dest: /etc/sogo/sogo.conf
mode: 0400
owner: sogo
group: sogo
- name: '[sogo] /var/spool/sogo'
file:
state: directory
dest: /var/spool/sogo
owner: sogo
group: sogo
mode: 0700
- name: '[sogo] /var/log/sogo'
file:
state: directory
dest: /var/log/sogo
owner: sogo
group: sogo
mode: 0700
- name: '[sogo] sogo.service'
template:
src: sogo.service.j2
dest: /etc/systemd/system/sogo.service
- name: '[sogo] start services'
systemd:
name: '{{item}}'
state: restarted
enabled: yes
daemon_reload: yes
with_items:
- sogo
- memcached