bifrost/playbooks/roles/bifrost-keystone-install/tasks/pip_install.yml
K Jonathan Harker f52ca4e8b5 Unquote empty braces inside jinja blocks
Quoting empty braces inside jinja blocks (i.e. {{ '{}' }}) tells jinja to treat
the braces as a string instead of as an empty dict. Since these occur in jinja
blocks, the yaml processor has already interpretted them as strings, and there is
no threat of the yaml processor interpretting the braces as a yaml object.

As-is, the quoted strings cause errors such as:
  FAILED! => {"failed": true, "msg": "|combine expects dictionaries, got '{}'"}

Change-Id: I4f859d8e3b9eff7ce962d7690c1ceea3e6229fe5
2017-10-26 16:01:15 -07:00

29 lines
1.3 KiB
YAML

# 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: "Install {{ package }} package from pip"
pip:
name: "{{ package }}"
state: "{{ state | default(omit) }}"
version: "{{ version | default(omit) }}"
virtualenv: "{{ bifrost_venv_dir if enable_venv else omit }}"
extra_args: "{{ extra_args | default(omit) }}"
when: source_install is not defined or source_install == false
# NOTE (cinerama): We should be able to use the pip module here and
# possibly merge these two tasks when
# https://github.com/ansible/ansible-modules-core/pull/2600 lands.
- name: "Install from {{ sourcedir }} using pip"
command: pip install --upgrade {{ sourcedir }} {{ extra_args | default('') }}
when: source_install is defined and (source_install | bool == true)
environment: "{{ bifrost_venv_env if enable_venv else {} }}"