This commit is contained in:
Hadrien 2022-06-06 20:20:27 +02:00
parent 269f3b7997
commit f46cd1ee60
4 changed files with 12 additions and 61 deletions

View File

@ -1,24 +1,9 @@
# Fuz Playbooks
Playbooks for (relatively) easy sysadmin!
Playbooks pour installation via Ansible de services pour le Fuz.
ansible-galaxy install -r requirements.yml
## With Vagrant
1. Install Vagrant
2. `vagrant up`
3. Install ansible:
```bash
sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
```
<!-- 3. Install the roles: `ansible-galaxy install -r requirements.yml` -->
4. Launch the playbook: `ansible-playbook setup.yml`
## With a real server
1. Edit the file `hosts.ini`
## Deployment
1. Edit the file `hosts.ini` and the variables in `matrix.yml`.
2. Install ansible:
```bash
sudo apt update

View File

@ -1 +0,0 @@
<name> ansible_connection=ssh ansible_user=root ansible_password=<password> ansible_host=<host> ansible_become=yes

View File

@ -1,6 +1,6 @@
---
- hosts:
- scaleway
- sonic-preprod
handlers:
- name: reboot
reboot:

View File

@ -1,10 +1,11 @@
---
- hosts: scaleway
- hosts: synapse
# todo: create user for synapse
vars:
matrix_synapse_version: "v1.5.1-py3"
# matrix_synapse_version: "v1.5.1"
matrix_server_name: matrix-test.local
matrix_bind_address: "51.158.114.109"
matrix_server_name: matrix-sonic-beta.local
matrix_bind_address: "192.168.42.4"
matrix_synapse_pg_host: synapse-postgres # does it need to be an IP?
matrix_synapse_db_name: psycopg2
@ -13,10 +14,7 @@
matrix_synapse_pg_db: "synapse"
matrix_registration_shared_secret: "xxxxx"
matrix_synapse_report_stats: false
matrix_synapse_config_dir: "/etc/matrix-synapse"
matrix_synapse_config_path: "{{ matrix_synapse_config_dir }}/homeserver.yaml"
matrix_synapse_config_docker_path: "/config/homeserver.yaml"
matrix_synapse_config_docker_dir: "/config"
matrix_synapse_config_path: "/etc/matrix-synapse/homeserver.yaml"
# to implement
# matrix_no_tls: true
@ -24,49 +22,18 @@
tasks:
# - docker_volume:
# name: synapse-data
- name: Create config directory
file:
path: "{{ matrix_synapse_config_dir }}"
state: directory
- template:
src: templates/homeserver.yaml.j2
dest: "{{ matrix_synapse_config_path }}"
- name: Create config directory
file:
path: "/etc/docker"
state: directory
src: templates/synapse_homeserver.yaml.j2
dest: {{ matrix_synapse_config_path }}
- template:
src: templates/docker-compose-matrix.yml.j2
dest: /etc/docker/docker-compose.yml
- name: Install required system packages
apt: name={{ item }} state=latest update_cache=yes
loop: [ 'apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common', 'python3-pip']
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: Update apt and install docker-ce
apt: update_cache=yes name=docker-ce state=latest
- name: install pip docker
pip: name={{ item }}
loop: ['docker', 'docker-compose']
- name: Create and start matrix services
docker_compose:
project_src: /etc/docker/
project_src: matrix
register: output