81 lines
2.3 KiB
YAML
81 lines
2.3 KiB
YAML
---
|
|
# Copyright 2016, Ian Cordasco
|
|
#
|
|
# 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.
|
|
|
|
- include: barbican_install_apt.yml
|
|
when:
|
|
- ansible_pkg_mgr == 'apt'
|
|
tags:
|
|
- barbican-apt-packages
|
|
- barbican-apt-sources
|
|
- barbican-install
|
|
|
|
- name: Create developer mode constraint file
|
|
copy:
|
|
dest: "/opt/developer-pip-constraints.txt"
|
|
content: |
|
|
{% for item in barbican_developer_constraints %}
|
|
{{ item }}
|
|
{% endfor %}
|
|
when:
|
|
- barbican_developer_mode | bool
|
|
tags:
|
|
- barbican-install
|
|
- barbican-pip-packages
|
|
|
|
- name: Clone requirements git repository
|
|
git:
|
|
repo: "{{ barbican_requirements_git_repo }}"
|
|
dest: "/opt/requirements"
|
|
clone: yes
|
|
update: yes
|
|
version: "{{ barbican_requirements_git_install_branch }}"
|
|
when:
|
|
- barbican_developer_mode | bool
|
|
tags:
|
|
- barbican-install
|
|
- barbican-pip-packages
|
|
|
|
- name: Add constraints to pip_install_options fact for developer mode
|
|
set_fact:
|
|
pip_install_options_fact: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt"
|
|
when:
|
|
- barbican_developer_mode | bool
|
|
tags:
|
|
- barbican-install
|
|
- barbican-pip-packages
|
|
|
|
- name: Set pip_install_options_fact when not in developer mode
|
|
set_fact:
|
|
pip_install_options_fact: "{{ pip_install_options|default('') }}"
|
|
when:
|
|
- not barbican_developer_mode | bool
|
|
tags:
|
|
- barbican-install
|
|
- barbican-pip-packages
|
|
|
|
- name: Install pip packages for Barbican
|
|
pip:
|
|
name: "{{ item }}"
|
|
state: "latest"
|
|
extra_args: "{{ pip_install_options_fact }}"
|
|
register: install_barbican_pip_packages
|
|
until: install_barbican_pip_packages |success
|
|
retries: 5
|
|
delay: 2
|
|
with_items: "{{ barbican_pip_packages }}"
|
|
tags:
|
|
- barbican-install
|
|
- barbican-pip-packages
|