From f46cd1ee60549bf953c81984ca0e9c18a8fc395a Mon Sep 17 00:00:00 2001 From: Hadrien Date: Mon, 6 Jun 2022 20:20:27 +0200 Subject: [PATCH] ok --- README.md | 21 +++----------------- hosts.ini.example | 1 - main.yml | 2 +- matrix.yml | 49 ++++++++--------------------------------------- 4 files changed, 12 insertions(+), 61 deletions(-) delete mode 100644 hosts.ini.example diff --git a/README.md b/README.md index adda2b3..4b92c6a 100644 --- a/README.md +++ b/README.md @@ -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 - ``` - -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 diff --git a/hosts.ini.example b/hosts.ini.example deleted file mode 100644 index a839358..0000000 --- a/hosts.ini.example +++ /dev/null @@ -1 +0,0 @@ - ansible_connection=ssh ansible_user=root ansible_password= ansible_host= ansible_become=yes \ No newline at end of file diff --git a/main.yml b/main.yml index d24a789..7ada3ff 100644 --- a/main.yml +++ b/main.yml @@ -1,6 +1,6 @@ --- - hosts: - - scaleway + - sonic-preprod handlers: - name: reboot reboot: diff --git a/matrix.yml b/matrix.yml index e273434..c54f53e 100644 --- a/matrix.yml +++ b/matrix.yml @@ -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