Application de develop sur octo #1

Open
lucaskev wants to merge 15 commits from develop into main
4 changed files with 12 additions and 61 deletions
Showing only changes of commit f46cd1ee60 - Show all commits

View File

@ -1,24 +1,9 @@
# Fuz Playbooks # Fuz Playbooks
Playbooks for (relatively) easy sysadmin! Playbooks pour installation via Ansible de services pour le Fuz.
ansible-galaxy install -r requirements.yml ## Deployment
1. Edit the file `hosts.ini` and the variables in `matrix.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`
2. Install ansible: 2. Install ansible:
```bash ```bash
sudo apt update 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: - hosts:
- scaleway - sonic-preprod
handlers: handlers:
- name: reboot - name: reboot
reboot: reboot:

View File

@ -1,10 +1,11 @@
--- ---
- hosts: scaleway - hosts: synapse
# todo: create user for synapse
vars: vars:
matrix_synapse_version: "v1.5.1-py3" matrix_synapse_version: "v1.5.1-py3"
# matrix_synapse_version: "v1.5.1" # matrix_synapse_version: "v1.5.1"
matrix_server_name: matrix-test.local matrix_server_name: matrix-sonic-beta.local
matrix_bind_address: "51.158.114.109" matrix_bind_address: "192.168.42.4"
matrix_synapse_pg_host: synapse-postgres # does it need to be an IP? matrix_synapse_pg_host: synapse-postgres # does it need to be an IP?
matrix_synapse_db_name: psycopg2 matrix_synapse_db_name: psycopg2
@ -13,10 +14,7 @@
matrix_synapse_pg_db: "synapse" matrix_synapse_pg_db: "synapse"
matrix_registration_shared_secret: "xxxxx" matrix_registration_shared_secret: "xxxxx"
matrix_synapse_report_stats: false matrix_synapse_report_stats: false
matrix_synapse_config_dir: "/etc/matrix-synapse" matrix_synapse_config_path: "/etc/matrix-synapse/homeserver.yaml"
matrix_synapse_config_path: "{{ matrix_synapse_config_dir }}/homeserver.yaml"
matrix_synapse_config_docker_path: "/config/homeserver.yaml"
matrix_synapse_config_docker_dir: "/config"
# to implement # to implement
# matrix_no_tls: true # matrix_no_tls: true
@ -24,49 +22,18 @@
tasks: tasks:
# - docker_volume: # - docker_volume:
# name: synapse-data # name: synapse-data
- name: Create config directory
file:
path: "{{ matrix_synapse_config_dir }}"
state: directory
- template: - template:
src: templates/homeserver.yaml.j2 src: templates/synapse_homeserver.yaml.j2
dest: "{{ matrix_synapse_config_path }}" dest: {{ matrix_synapse_config_path }}
- name: Create config directory
file:
path: "/etc/docker"
state: directory
- template: - template:
src: templates/docker-compose-matrix.yml.j2 src: templates/docker-compose-matrix.yml.j2
dest: /etc/docker/docker-compose.yml 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 - name: Create and start matrix services
docker_compose: docker_compose:
project_src: /etc/docker/ project_src: matrix
register: output register: output