From cfeec1cc3ae300d3e0003c76fbca3c799737f88a Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 14 Sep 2015 18:53:07 -0500 Subject: [PATCH] adds the config_template to pip_lock_down The change modifies the pip_lock_down template tasks such that it's now using the config_template action plugin. This change will make so that config files can be dynamically updated, by a deployer, at run time, without requiring the need to modify the in tree templates or defaults. Partially implements: blueprint tunable-openstack-configuration Change-Id: I620b7f599a9e41f5fe38a2d038b53cfa227c1d55 --- playbooks/roles/pip_lock_down/defaults/main.yml | 3 +++ playbooks/roles/pip_lock_down/tasks/main.yml | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/pip_lock_down/defaults/main.yml b/playbooks/roles/pip_lock_down/defaults/main.yml index 3149d944b0..6e9059d02c 100644 --- a/playbooks/roles/pip_lock_down/defaults/main.yml +++ b/playbooks/roles/pip_lock_down/defaults/main.yml @@ -27,3 +27,6 @@ pip_allow_all_external: true # Drop link files to lock down pip pip_links: - { name: "openstack_release", link: "{{ openstack_repo_url }}/os-releases/{{ openstack_release }}/" } + +## Tunable overrides +pip_global_conf_overrides: {} diff --git a/playbooks/roles/pip_lock_down/tasks/main.yml b/playbooks/roles/pip_lock_down/tasks/main.yml index 6b6d57cbe1..94882c5a7e 100644 --- a/playbooks/roles/pip_lock_down/tasks/main.yml +++ b/playbooks/roles/pip_lock_down/tasks/main.yml @@ -41,14 +41,19 @@ - lock-pip-files - name: Drop pip global config(s) - template: + config_template: src: "{{ item.src }}" dest: "{{ item.dest }}" owner: "{{ ansible_user_id }}" group: "{{ ansible_user_id }}" - mode: "{{ item.mode|default('0644') }}" + mode: "0644" + config_overrides: "{{ item.config_overrides }}" + config_type: "{{ item.config_type }}" with_items: - - { src: "global.conf.j2", dest: "{{ ansible_env.HOME }}/.pip/base/global.conf" } + - src: "global.conf.j2" + dest: "{{ ansible_env.HOME }}/.pip/base/global.conf" + config_overrides: "{{ pip_global_conf_overrides }}" + config_type: "ini" tags: - lock-pip-files