Files
openstack-ansible/playbooks/roles/pip_lock_down/tasks/main.yml
kevin a4179512bc Changed link lineinfile to template
This change ensures that all link files created are built from a template
rather than using the lineinfile module which will result in multiple entries
per file. While these multiple entries do not break deployments they do create
a slower install / upgrade time.

Change-Id: I4fef53baf075c953ac73500e72f9388f7ccfa2a0
Closes-Bug: #1468587
2015-06-24 22:11:12 -05:00

71 lines
2.1 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)
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: "{{ item.mode|default('0644') }}"
with_items:
- { src: "global.conf.j2", dest: "{{ ansible_env.HOME }}/.pip/base/global.conf" }
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