From 20a8436d0f2bf6a3a5e4925f3d05fe37025cde58 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 16 Aug 2017 14:33:22 +0000 Subject: [PATCH] Don't install bifrost into local virtualenv Bifrost is no longer required to be installed locally. --- ansible/kolla-bifrost.yml | 10 ---- ansible/roles/kolla-bifrost/defaults/main.yml | 12 ----- ansible/roles/kolla-bifrost/tasks/config.yml | 16 ------ ansible/roles/kolla-bifrost/tasks/install.yml | 53 ------------------- ansible/roles/kolla-bifrost/tasks/main.yml | 20 ++++--- 5 files changed, 14 insertions(+), 97 deletions(-) delete mode 100644 ansible/roles/kolla-bifrost/tasks/config.yml delete mode 100644 ansible/roles/kolla-bifrost/tasks/install.yml diff --git a/ansible/kolla-bifrost.yml b/ansible/kolla-bifrost.yml index fcda9d7f9..88ae930b6 100644 --- a/ansible/kolla-bifrost.yml +++ b/ansible/kolla-bifrost.yml @@ -7,14 +7,6 @@ - { name: agent_ipmitool, enabled: "{{ kolla_bifrost_enable_ipmitool_drivers | bool }}" } pre_tasks: - - name: Fail if not running in a virtualenv - fail: - msg: > - This playbook should be executed from a virtualenv in order to avoid - installing python packages to the system location. Typically this - will be named 'kayobe-venv' - when: "{{ not lookup('env', 'VIRTUAL_ENV') }}" - - name: Check whether a Kolla Bifrost extra globals configuration file exists stat: path: "{{ kolla_bifrost_extra_globals_path }}" @@ -31,8 +23,6 @@ roles: - role: kolla-bifrost - kolla_bifrost_venv: "{{ lookup('env', 'VIRTUAL_ENV') }}" - # Generate a list of enabled drivers from the map. kolla_bifrost_enabled_drivers: > {{ kolla_bifrost_driver_map | selectattr('enabled') | map(attribute='name') | list }} diff --git a/ansible/roles/kolla-bifrost/defaults/main.yml b/ansible/roles/kolla-bifrost/defaults/main.yml index fc3b495e4..2ac0cc855 100644 --- a/ansible/roles/kolla-bifrost/defaults/main.yml +++ b/ansible/roles/kolla-bifrost/defaults/main.yml @@ -1,16 +1,4 @@ --- -# Path to directory for source code checkouts. -source_checkout_path: - -# Virtualenv directory where Bifrost will be installed. -kolla_bifrost_venv: - -# URL of Bifrost source code repository. -kolla_bifrost_source_url: - -# Version (branch, tag, etc.) of Bifrost source code repository. -kolla_bifrost_source_version: - # Directory where Kolla custom configuration files will be installed. kolla_node_custom_config_path: diff --git a/ansible/roles/kolla-bifrost/tasks/config.yml b/ansible/roles/kolla-bifrost/tasks/config.yml deleted file mode 100644 index 9469bff27..000000000 --- a/ansible/roles/kolla-bifrost/tasks/config.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: Ensure the Kolla Bifrost configuration directores exist - file: - path: "{{ kolla_node_custom_config_path }}/bifrost" - state: directory - mode: 0750 - -- name: Ensure the Kolla Bifrost configuration files exist - template: - src: "{{ item.src }}" - dest: "{{ kolla_node_custom_config_path }}/bifrost/{{ item.dest }}" - mode: 0640 - with_items: - - { src: bifrost.yml.j2, dest: bifrost.yml } - - { src: dib.yml.j2, dest: dib.yml } - - { src: servers.yml.j2, dest: servers.yml } diff --git a/ansible/roles/kolla-bifrost/tasks/install.yml b/ansible/roles/kolla-bifrost/tasks/install.yml deleted file mode 100644 index bcfd2aacd..000000000 --- a/ansible/roles/kolla-bifrost/tasks/install.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -- name: Ensure EPEL repo is installed - yum: - name: epel-release - state: installed - become: True - -- name: Ensure required packages are installed - yum: - name: "{{ item }}" - state: installed - become: True - with_items: - - gcc - - libffi-devel - - openssl-devel - - python-devel - - python-pip - - python-virtualenv - -- name: Ensure source code checkout path exists - file: - path: "{{ source_checkout_path }}" - state: directory - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - recurse: True - become: True - -- name: Ensure Bifrost source code checkout exists - git: - repo: "{{ kolla_bifrost_source_url }}" - dest: "{{ source_checkout_path }}/bifrost" - version: "{{ kolla_bifrost_source_version }}" - -- name: Ensure the latest version of pip is installed - pip: - name: "{{ item.name }}" - state: latest - virtualenv: "{{ kolla_bifrost_venv }}" - with_items: - - { name: pip } - -- name: Ensure required Python packages are installed - pip: - name: "{{ item.name }}" - version: "{{ item.version | default(omit) }}" - state: present - virtualenv: "{{ kolla_bifrost_venv }}" - with_items: - # Intall Bifrost from source. - - name: "{{ source_checkout_path }}/bifrost" - - name: shade diff --git a/ansible/roles/kolla-bifrost/tasks/main.yml b/ansible/roles/kolla-bifrost/tasks/main.yml index 969f7a192..9469bff27 100644 --- a/ansible/roles/kolla-bifrost/tasks/main.yml +++ b/ansible/roles/kolla-bifrost/tasks/main.yml @@ -1,8 +1,16 @@ --- -- include: install.yml - tags: - - install +- name: Ensure the Kolla Bifrost configuration directores exist + file: + path: "{{ kolla_node_custom_config_path }}/bifrost" + state: directory + mode: 0750 -- include: config.yml - tags: - - config +- name: Ensure the Kolla Bifrost configuration files exist + template: + src: "{{ item.src }}" + dest: "{{ kolla_node_custom_config_path }}/bifrost/{{ item.dest }}" + mode: 0640 + with_items: + - { src: bifrost.yml.j2, dest: bifrost.yml } + - { src: dib.yml.j2, dest: dib.yml } + - { src: servers.yml.j2, dest: servers.yml }