openstack-ansible-os_congress/tasks/congress_install.yml

98 lines
2.9 KiB
YAML

---
# Copyright 2017, taseer94@gmail.com
# All rights reserved.
#
# 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: clone congress repo
git:
repo: "{{ congress_git_repo }}"
dest: /opt/congress
clone: yes
- name: install congress
shell: python setup.py install
args:
chdir: /opt/congress
#- name: Install required pip packages
# pip:
# name: "{{ congress_requires_pip_packages | join(' ') }}"
# state: "{{ congress_package_state }}"
# register: install_packages
# until: install_packages|success
# retries: 5
# delay: 2
#- name: Retrieve checksum for venv download
# uri:
# url: "{{ congress_venv_download_url | replace('tgz', 'checksum') }}"
# return_content: yes
# register: congress_venv_checksum
# when: not congress_developer_mode | bool
#- name: Attempt venv download
# get_url:
# url: "{{ congress_venv_download_url }}"
# dest: "/var/cache/{{ congress_venv_download_url | basename }}"
# checksum: "sha1:{{ congress_venv_checksum.content | trim }}"
# register: congress_get_venv
# when: not congress_developer_mode | bool
#- name: Remove existing venv
# file:
# path: "{{ congress_bin | dirname }}"
# state: absent
# when: congress_get_venv | changed
#- name: Create congress venv dir
# file:
# path: "{{ congress_bin | dirname }}"
# state: directory
# register: congress_venv_dir
# when: not congress_developer_mode | bool
#- name: Unarchive pre-built venv
# unarchive:
# src: "/var/cache/{{ congress_venv_download_url | basename }}"
# dest: "{{ congress_bin | dirname }}"
# copy: "no"
# when:
# - not congress_developer_mode | bool
# - congress_get_venv | changed or congress_venv_dir | changed
#- name: Install pip packages
# pip:
# name: "{{ congress_pip_packages | join(' ') }}"
# state: "{{ congress_package_state }}"
# virtualenv: "{{ congress_bin | dirname }}"
# virtualenv_site_packages: "no"
# register: install_packages
# until: install_packages|success
# retries: 5
# delay: 2
# when: congress_developer_mode | bool
#- name: Update virtualenv path
# command: >
# virtualenv-tools --update-path=auto --reinitialize {{ congress_bin | dirname }}
# when:
# - not congress_developer_mode | bool
# - congress_get_venv | changed or congress_venv_dir | changed
#- name: Record the venv tag deployed
# ini_file:
# dest: "/etc/ansible/facts.d/openstack_ansible.fact"
# section: congress
# option: venv_tag
# value: "{{ congress_venv_tag }}"