From b046052aedeee0ad3ca2d19a5c89dbd33a784ea3 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 30 Aug 2017 12:00:47 +0300 Subject: [PATCH] Switch from playbook vars to role defaults By using role defauts, we can have inventory variables which overide the defaults. --- README.md | 2 +- vars/vars.yml => roles/matrix-server/defaults/main.yml | 2 +- setup.yml | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) rename vars/vars.yml => roles/matrix-server/defaults/main.yml (96%) diff --git a/README.md b/README.md index eacc8992c..8fc23d426 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ You can follow these steps: - copy the sample configuration file (`cp examples/host-vars.yml inventory/matrix./vars.yml`) -- edit the configuration file (`inventory/matrix./vars.yml`) to your liking +- edit the configuration file (`inventory/matrix./vars.yml`) to your liking. You may also take a look at `roles/matrix-server/defaults.main.yml` and see if there's something you'd like to copy over and override in your `vars.yml` configuration file. - copy the sample inventory hosts file (`cp examples/hosts inventory/hosts`) diff --git a/vars/vars.yml b/roles/matrix-server/defaults/main.yml similarity index 96% rename from vars/vars.yml rename to roles/matrix-server/defaults/main.yml index 7466a2a3f..a7aafc17f 100644 --- a/vars/vars.yml +++ b/roles/matrix-server/defaults/main.yml @@ -44,4 +44,4 @@ matrix_services_restart_cron_time_definition: "15 4 3 * *" matrix_coturn_turn_udp_min_port: 49152 matrix_coturn_turn_udp_max_port: 49172 -matrix_coturn_turn_external_ip_address: "{{ ansible_host }}" +matrix_coturn_turn_external_ip_address: "{{ ansible_host }}" \ No newline at end of file diff --git a/setup.yml b/setup.yml index d09f727eb..d0364f76e 100644 --- a/setup.yml +++ b/setup.yml @@ -3,8 +3,5 @@ hosts: "{{ target if target is defined else 'matrix-servers' }}" become: true - vars_files: - - vars/vars.yml - roles: - matrix-server