cfeec1cc3a
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
76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
---
|
|
# Copyright 2014, Rackspace US, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
- name: Create pip config directory
|
|
file:
|
|
path: "{{ item }}"
|
|
state: "directory"
|
|
group: "{{ ansible_user_id }}"
|
|
owner: "{{ ansible_user_id }}"
|
|
with_items:
|
|
- "{{ ansible_env.HOME }}/.pip"
|
|
- "{{ ansible_env.HOME }}/.pip/base"
|
|
- "{{ ansible_env.HOME }}/.pip/links.d"
|
|
- "{{ ansible_env.HOME }}/.cache"
|
|
- "{{ ansible_env.HOME }}/.cache/pip"
|
|
tags:
|
|
- lock-directories-pip
|
|
|
|
- name: Drop pip lockdown file(s)
|
|
copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: "{{ ansible_user_id }}"
|
|
group: "{{ ansible_user_id }}"
|
|
mode: "{{ item.mode|default('0644') }}"
|
|
with_items:
|
|
- { src: "pip-link-build.py", dest: "{{ ansible_env.HOME }}/.pip/pip-link-build.py", mode: "0755" }
|
|
tags:
|
|
- lock-pip-files
|
|
|
|
- name: Drop pip global config(s)
|
|
config_template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: "{{ ansible_user_id }}"
|
|
group: "{{ ansible_user_id }}"
|
|
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"
|
|
config_overrides: "{{ pip_global_conf_overrides }}"
|
|
config_type: "ini"
|
|
tags:
|
|
- lock-pip-files
|
|
|
|
- name: Drop pip link file(s)
|
|
template:
|
|
src: "link_file.j2"
|
|
dest: "{{ ansible_env.HOME }}/.pip/links.d/{{ item.name }}.link"
|
|
owner: "{{ ansible_user_id }}"
|
|
group: "{{ ansible_user_id }}"
|
|
mode: "{{ item.mode|default('0644') }}"
|
|
with_items: pip_links
|
|
tags:
|
|
- lock-pip-files
|
|
|
|
- name: Execute pip config builder
|
|
command: "{{ ansible_env.HOME }}/.pip/pip-link-build.py"
|
|
changed_when: false
|
|
tags:
|
|
- lock-down-pip-conf
|