infrastructure/playbooks/02-xmpp-server.yaml

78 lines
No EOL
2.2 KiB
YAML

- name: Configuration of jabber server
hosts: chatservers
tasks:
- name: Use variables
ansible.builtin.include_vars: vars.yml
- name: Configure ejabber apt sources
ansible.builtin.blockinfile:
path: /etc/apt/sources.list.d/process-one-stable.sources
create: true
block: |
Enabled: yes
Types: deb
URIs: https://repo.process-one.net/deb
Suites: stable
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/ejabberd.gpg
owner: "{{ root.user }}"
group: "{{ root.group }}"
mode: "755"
- name: Create keyrings folder
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
owner: "{{ root.user }}"
group: "{{ root.group }}"
mode: "755"
- name: Adding process-one (ejabberd) gpg key to apt keyring
ansible.builtin.get_url:
url: https://repo.process-one.net/ejabberd.gpg
dest: /etc/apt/keyrings/ejabberd.gpg
owner: "{{ root.user }}"
group: "{{ root.group }}"
mode: "755"
- name: Installing required packages
ansible.builtin.package:
name:
- composer
- php-fpm
- php-curl
- php-mbstring
- php-imagick
- php-gd
- php-pgsql
- php-xml
- postgresql
- nginx
- certbot
- ejabberd
- git
- python3-certbot-nginx
- python3-psycopg2
state: present
- name: "Ensure movim database is present and accessible"
ansible.builtin.include_tasks:
file: tasks/chat/database.yml
- name: "Ensure movim version is installed - v{{ movim.version }}"
ansible.builtin.include_tasks:
file: tasks/chat/movim.yml
- name: "Ensure ejabberd is configured"
ansible.builtin.include_tasks:
file: tasks/chat/ejabberd.yml
- name: "Ensure nginx is configured"
ansible.builtin.include_tasks:
file: tasks/chat/nginx.yml
- name: "Ensure X512 certs are presents"
ansible.builtin.include_tasks:
file: tasks/chat/tls.yml