From a0961948c8d5c53911a46ddb6252b1cfc5b3c616 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Wed, 25 Apr 2018 19:16:08 -0400 Subject: [PATCH] Provide a hook for overriding configuration Change-Id: Id2e3370c359e530219927e8f89c0c80443031bd9 --- defaults/main.yml | 7 +++++++ tasks/main.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index e31d9e8..9175b5d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -36,3 +36,10 @@ ara: nginx: # Where nginx will store the proxy cache cache_directory: /var/cache/nginx + +# You can use a variable called ara_override to use custom configuration +# parameters. + +# ara_override: +# config: +# database: "mysql+pymysql://ara:password@localhost/ara" diff --git a/tasks/main.yml b/tasks/main.yml index 24290f7..a701085 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -19,6 +19,13 @@ - "{{ ansible_distribution }}.yml" - "{{ ansible_os_family }}.yml" +- name: Override default variables + set_fact: + ara: "{{ ara | combine(ara_override, recursive=true) }}" + when: + - ara_override is defined + - ara_override is mapping + - name: Install required dependencies become: true package: