Skip to content

Commit

Permalink
add new role for ISSU - openstack_compute_legacy
Browse files Browse the repository at this point in the history
Change-Id: I3ad5dd8e85f4dd2c205072f37bc2009fdcf380f6
Partial-Bug: #1774441
  • Loading branch information
Andrey-mp committed Jun 6, 2018
1 parent 97d4941 commit 68b8068
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
29 changes: 29 additions & 0 deletions playbooks/roles/install_contrail/tasks/compute_legacy.yml
@@ -0,0 +1,29 @@
---
# run openstack-compute-init container with mounted volumes:
# /usr/bin:/opt/plugin/bin
# PYTHONPATH:/opt/plugin/site-packages

- name: create /etc/contrail/compute-legacy
file:
path: /etc/contrail/compute-legacy
state: directory
recurse: yes

- name: Getting PYTHONPATH
shell: python -c "import sys; paths = [path for path in sys.path if 'packages' in path] ; print(paths[-1])"
register: pythonpath

- name: update image
shell: "docker pull {{ container_registry }}/{{ item }}:{{ contrail_version_tag }}"
with_items:
- contrail-openstack-compute-init
when: UPDATE_IMAGES is undefined or UPDATE_IMAGES != false

- name: "create contrail compute-legacy compose file"
template:
src: contrail-compute-legacy.yaml.j2
dest: "/etc/contrail/compute-legacy/docker-compose.yaml"

- name: "start contrail compute-legacy"
docker_service:
project_src: /etc/contrail/compute-legacy
7 changes: 5 additions & 2 deletions playbooks/roles/install_contrail/tasks/main.yml
Expand Up @@ -20,9 +20,8 @@

- name: set orchestrator param
set_fact:
contrail_configuration: "{{ contrail_configuration | combine({'CLOUD_ORCHESTRATOR': orchestrator}) }}"
contrail_configuration: "{{ contrail_configuration | combine({'CLOUD_ORCHESTRATOR': orchestrator | default('none')}) }}"
when:
- orchestrator is defined
- contrail_configuration.CLOUD_ORCHESTRATOR is not defined
tags:
- always
Expand Down Expand Up @@ -284,6 +283,10 @@
tags:
- vrouter

- name: Pluginize legacy compute
include: compute_legacy.yml
when: roles[instance_name].openstack_compute_legacy is defined

- name: join k8s master
include: configure_k8s_join_node.yml
when: roles[instance_name].k8s_node is defined and k8s_master_name is defined and inventory_hostname != k8s_master_name
Expand Down
@@ -0,0 +1,8 @@
version: '2'
services:
openstack-compute-legacy:
image: "{{ container_registry }}/contrail-openstack-compute-init:{{ contrail_version_tag }}"
network_mode: "host"
volumes:
- /usr/bin:/opt/plugin/bin
- {{ pythonpath.stdout }}:/opt/plugin/site-packages

0 comments on commit 68b8068

Please sign in to comment.