summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-22 22:05:43 +0000
committerGerrit Code Review <review@openstack.org>2018-08-22 22:05:43 +0000
commit4ee00a9a7881a9bfd70bb4eef2267718a0259d25 (patch)
treed2d08ae8d16fdc5870042ab84506e879040016c1
parent3747b011cd279db18bc7802ab87f09ded1a78516 (diff)
parent92137f69b643319c79483d88b2b34c819a35b42e (diff)
Merge "Rewrite deployment of plugin by devstack"
-rw-r--r--doc/source/installation/deployment_architecture.pngbin0 -> 42917 bytes
-rw-r--r--doc/source/installation/playbooks.rst188
-rw-r--r--playbooks/contrail.yml10
-rw-r--r--playbooks/deploy_driver.yml9
-rw-r--r--playbooks/env.yml11
-rw-r--r--playbooks/group_vars/all.yml33
-rw-r--r--playbooks/hosts7
-rwxr-xr-xplaybooks/main.yml16
-rw-r--r--playbooks/openstack.yml11
-rw-r--r--playbooks/prepare.yml8
-rw-r--r--playbooks/roles/common/defaults/main.yml11
-rw-r--r--playbooks/roles/common/tasks/check_variables.yml27
-rw-r--r--playbooks/roles/common/tasks/dependencies.yml33
-rw-r--r--playbooks/roles/common/tasks/hostname.yml10
-rw-r--r--playbooks/roles/common/tasks/main.yml9
-rw-r--r--playbooks/roles/common/tasks/nameserver.yml17
-rw-r--r--playbooks/roles/common/tasks/ssh_keys.yml7
-rw-r--r--playbooks/roles/common/tasks/ubuntu_xenial.yml10
-rw-r--r--playbooks/roles/common/vars/main.yml4
-rw-r--r--playbooks/roles/contrail_node/tasks/contrail.yml128
-rw-r--r--playbooks/roles/contrail_node/tasks/main.yml3
-rw-r--r--playbooks/roles/contrail_node/tasks/update_kernel.yml19
-rw-r--r--playbooks/roles/contrail_node/templates/hosts.j24
-rw-r--r--playbooks/roles/contrail_node/templates/instances.yaml.j250
-rw-r--r--playbooks/roles/contrail_vm/files/Analytics-SConscript.patch10
-rw-r--r--playbooks/roles/contrail_vm/files/contrail_config.patch38
-rw-r--r--playbooks/roles/contrail_vm/files/contrail_patches4
-rw-r--r--playbooks/roles/contrail_vm/files/contrail_plugin_diff.patch35
-rw-r--r--playbooks/roles/contrail_vm/files/plugin.patch41
-rw-r--r--playbooks/roles/contrail_vm/meta/main.yml4
-rw-r--r--playbooks/roles/contrail_vm/tasks/contrail_patches.yml26
-rw-r--r--playbooks/roles/contrail_vm/tasks/dependencies.yml20
-rw-r--r--playbooks/roles/contrail_vm/tasks/kernel.yml30
-rw-r--r--playbooks/roles/contrail_vm/tasks/main.yml7
-rw-r--r--playbooks/roles/contrail_vm/tasks/stack_sh.yml18
-rw-r--r--playbooks/roles/devstack_compute_node/tasks/main.yml41
-rw-r--r--playbooks/roles/devstack_compute_node/templates/compute_local.conf.j236
-rw-r--r--playbooks/roles/devstack_controller_node/tasks/main.yml (renamed from playbooks/roles/fetch_devstack/tasks/fetch_devstack.yml)12
-rw-r--r--playbooks/roles/devstack_controller_node/templates/controller_local.conf.j254
-rw-r--r--playbooks/roles/fetch_devstack/defaults/main.yml11
-rw-r--r--playbooks/roles/fetch_devstack/meta/main.yml3
-rw-r--r--playbooks/roles/fetch_devstack/tasks/main.yml4
-rw-r--r--playbooks/roles/fetch_devstack/templates/contrail_local.conf.j247
-rw-r--r--playbooks/roles/fetch_devstack/templates/openstack_local.conf.j235
-rw-r--r--playbooks/roles/networking_bgpvpn_plugin/files/cfgm_common-0.1.dev0.tar.gzbin0 -> 91739 bytes
-rw-r--r--playbooks/roles/networking_bgpvpn_plugin/files/vnc_api-5.0.0.tar.gzbin0 -> 630705 bytes
-rw-r--r--playbooks/roles/networking_bgpvpn_plugin/tasks/main.yml75
-rw-r--r--playbooks/roles/openstack_vm/files/keystone.patch11
-rw-r--r--playbooks/roles/openstack_vm/files/keystone_stable-pike.patch10
-rw-r--r--playbooks/roles/openstack_vm/meta/main.yml5
-rw-r--r--playbooks/roles/openstack_vm/tasks/main.yml8
-rw-r--r--playbooks/roles/openstack_vm/tasks/openstack_patch.yml14
-rw-r--r--playbooks/roles/openstack_vm/tasks/stack_sh.yml12
-rw-r--r--playbooks/roles/restack_compute_node/tasks/main.yml15
-rw-r--r--playbooks/roles/restack_contrail/tasks/main.yml5
-rw-r--r--playbooks/roles/restack_contrail/tasks/services.yml10
-rw-r--r--playbooks/roles/restack_contrail/tasks/stack_sh.yml14
-rw-r--r--playbooks/roles/restack_contrail/tasks/unstack_sh.yml5
-rw-r--r--playbooks/roles/restack_controller_node/tasks/main.yml11
-rw-r--r--playbooks/roles/source_openrc/tasks/main.yml3
-rw-r--r--playbooks/roles/source_openrc/tasks/source_openrc.yml11
61 files changed, 543 insertions, 767 deletions
diff --git a/doc/source/installation/deployment_architecture.png b/doc/source/installation/deployment_architecture.png
new file mode 100644
index 0000000..4b1d14a
--- /dev/null
+++ b/doc/source/installation/deployment_architecture.png
Binary files differ
diff --git a/doc/source/installation/playbooks.rst b/doc/source/installation/playbooks.rst
index 5616619..bf964fe 100644
--- a/doc/source/installation/playbooks.rst
+++ b/doc/source/installation/playbooks.rst
@@ -3,9 +3,18 @@ Setup development VMs
3===================== 3=====================
4 4
5Playbooks are designed to setup two nodes. The first node 5Playbooks are designed to setup two nodes. The first node
6contains Openstack with, among others, keystone, neutron 6contains Openstack with, keystone, neutron, horizon, etc.
7and neutron-opencontrail plugin as ML2 L3 driver. 7It has also neutron-opencontrail plugin as neutron ML2 L3 driver.
8Second node contains nightly-build contrail node. 8Second node contains nightly-build contrail node with simple devstack as compute node.
9
10Playbooks deploy Openstack in stable/ocata version and OpenContrail in one of the latest nightly build.
11
12Overview of deployment architecture:
13
14.. image:: deployment_architecture.png
15 :width: 600px
16 :align: center
17 :alt: Diagram of deployment architecture
9 18
10Step by step instruction is presented below. 19Step by step instruction is presented below.
11 20
@@ -20,13 +29,13 @@ Before you run playbooks perform the following steps:
20 29
21Let's assume there are two hosts: 30Let's assume there are two hosts:
22 31
23+-----------+--------------+----------------+--------------+------------------------------------+ 32+-----------+--------------+--------------------------+------------+-------------+----------------------------------------+
24| Node | OS | Public IP | Internal IP | Notes | 33| Node | OS | Recommended requirements | Public IP | Internal IP | Notes |
25+===========+==============+================+==============+====================================+ 34+===========+==============+==========================+============+=============+========================================+
26| openstack | Ubuntu 16.04 | 10.100.0.3 | 192.168.0.3 | setup by playbooks | 35| openstack | Ubuntu 16.04 | RAM: 8 GB | 10.100.0.3 | 192.168.0.3 | devstack (controller node) |
27+-----------+--------------+----------------+--------------+------------------------------------+ 36+-----------+--------------+--------------------------+------------+-------------+----------------------------------------+
28| contrail | CentOS 7.4 | 10.100.0.2 | 192.168.0.2 | setup by contrail-ansible-deployer | 37| contrail | CentOS 7.4 | RAM: 16 GB | 10.100.0.2 | 192.168.0.2 | opencontrail + devstack (compute node) |
29+-----------+--------------+----------------+--------------+------------------------------------+ 38+-----------+--------------+--------------------------+------------+-------------+----------------------------------------+
30 39
31**2. Make sure you have key-based SSH access to prepared nodes** 40**2. Make sure you have key-based SSH access to prepared nodes**
32 41
@@ -54,159 +63,108 @@ Configuration require editing few files before running any playbook.
54 63
55**1. Define nodes by specifying SSH names or IP of machines in ``playbooks/hosts``** 64**1. Define nodes by specifying SSH names or IP of machines in ``playbooks/hosts``**
56 65
57.. code-block:: console
58
59 $ vim playbooks/hosts
60
61Change ``contrail-node`` and ``openstack-node`` to public IP of your machines. 66Change ``contrail-node`` and ``openstack-node`` to public IP of your machines.
62 67
63.. code-block:: text 68.. code-block:: text
64 69
65 [contrail] 70 controller ansible_host=10.100.0.3 ansible_user=ubuntu
66 10.100.0.2
67 71
68 [openstack] 72 [compute]
69 10.100.0.3 73 10.100.0.2 ansible_user=centos
70 74
71**2. Change deployment variables in ``playbooks/group_vars/all.yml``**
72 75
73.. code-block:: console 76Optionally, you can add a username to this config, if you ssh to machine with username: ``10.100.0.2 ansible_user=centos``
74 77
75 $ vim playbooks/group_vars/all.yml 78**2. Change deployment variables in ``playbooks/group_vars/all.yml``**
76 79
77``contrail_ip`` and ``openstack_ip`` should be internal IP addresses. 80``contrail_ip`` and ``openstack_ip`` should be internal IP addresses.
81``contrail_gateway`` should be gateway address of the contrail_ip.
82``contrail_interface`` should be interface name that has bound contrail ip.
78 83
79``openstack_branch`` should be set to ``stable/ocata`` 84``openstack_branch`` should be set to ``stable/ocata``
80``contrail_branch`` is currently ignored but it must not be empty. 85``install_networking_bgpvpn_plugin`` is a boolean value. If set true, it will install the neutron_bgpvpn plugin.
81
82Example config:
83 86
84.. code-block:: yaml 87.. code-block:: yaml
85 88
86 # [Required] IP address for OpenConrail VM. 89 # IP address for OpenConrail.
87 contrail_ip: 192.168.0.2 90 contrail_ip: 192.168.0.2
88 # [Required] IP address for Openstack VM.
89 openstack_ip: 192.168.0.3
90
91 # [Required] Openstack branch used on VMs.
92 openstack_branch: stable/ocata
93 # [Required] OpenContrail branch to build on VM.
94 contrail_branch: R4.1
95
96 # [Required] Kernel version supported by OpenContrail branch.
97 kernel_version: 4.4.0-112
98
99**3. Enable networking-opencontrail plugin**
100
101Update ``openstack_local.conf.j2`` template.
102
103.. code-block:: console
104
105 $ vim playbooks/roles/fetch_devstack/templates/openstack_local.conf.j2
106 91
107.. warning:: If plugin is already defined, 92 # Gateway address for OpenConrail.
108 make sure URL and branch version is correct. 93 contrail_gateway: 192.168.0.1
109 94
110At the end of file add new line with ``enable_plugin`` directive. 95 # Interface name for OpenConrail.
96 contrail_interface: eth0
111 97
112.. code-block:: text
113 98
114 enable_plugin networking-opencontrail https://github.com/openstack/networking-opencontrail stable/ocata 99 # IP address for Openstack VM.
100 openstack_ip: 192.168.0.3
115 101
116.. note:: Plugin branch should be the same as OpenStack. 102 # Openstack branch used on VMs.
117 For example if openstack_branch is ``stable/ocata`` 103 openstack_branch: stable/ocata
118 plugin also should point to ``stable/ocata`` branch.
119 104
105 # If true, then install networking_bgpvpn plugin with contrail driver
106 install_networking_bgpvpn_plugin: false
120 107
121********** 108**********
122Deployment 109Deployment
123********** 110**********
124 111
125Openstack node 112Run playbooks
126============== 113=============
127 114
128.. note:: Before openstack deployment make sure Playbooks are configured. 115.. note:: Before openstack deployment make sure playbooks are configured.
129 116
130Execute ``playbooks/main.yml`` file. 117Execute ``playbooks/main.yml`` file.
131Make sure you are in playbooks directory before executing playbook. 118Make sure you are in playbooks directory before executing the playbooks.
132This will make Ansible to use local ``hosts`` file instead of system broad defined hosts. 119This will make Ansible to use local ``hosts`` file instead of system broad defined hosts.
133 120
134.. code-block:: console 121.. code-block:: console
135 122
136 $ cd playbooks 123 $ cd playbooks
137 $ ./main.yml --limit openstack 124 $ ./main.yml
138
139 125
140Contrail node 126This playbooks can last 1 hour or more.
141=============
142 127
143**1. Clone Contrail Ansible Deployer from Github** 128Please be patient while executing roles with ``stack.sh``. Real time logs from these operations can be viewed on each host by following command:
129``less -R /opt/stack/logs/stack.sh.log``
144 130
145.. code-block:: console 131*****
132Usage
133*****
146 134
147 $ git clone http://github.com/Juniper/contrail-ansible-deployer 135Access web interface
136====================
148 137
149**2. Define contrail node by specifying SSH name or IP of machine in ``inventory/hosts``** 138* http://10.100.0.3/ - devstack's horizon. Credentials: admin/admin
150 139
151.. warning:: If file is not empty. Remove everything and start from scratch. 140* https://10.100.0.2:8143/ - OpenContrail UI. Credentials: admin/admin (domain can be empty or "default")
152 141
153Edit hosts file 142Create example VM
143=================
154 144
155.. code-block:: console 145After successful deployment, it could be possible to create sample Virtual Machine.
146It is important to create new security group, because the default is not synchronized correctly between contrail and devstack.
156 147
157 $ vim inventory/hosts 148These commands should be ran on one of the nodes (both are connected to one neutron).
158 149Assuming that contrail node has ``contrail-node.novalocal`` hostname (used in availability zone):
159Copy and paste snippet at the end of the file and change IP to Contrail machine public IP
160
161.. code-block:: text
162
163 container_hosts:
164 hosts:
165 10.100.0.2:
166 ansible_user: centos
167
168**3. Contrail nightly builds variables**
169
170Currently, nightly-builds are available in docker hub's opencontrailnightly repo.
171At https://hub.docker.com/r/opencontrailnightly/contrail-agent-vrouter/tags/
172can be viewed available contrail builds.
173
174* ``CONTRAIL_VERSION``: container tag for example ``latest``
175* ``CONTROLLER_NODES``: internal IP of contrail node
176* ``KEYSTONE_AUTH_HOST``: internal IP of openstack node
177* roles ``<IP>``: public IP of contrail node
178
179Edit inventory variables:
180 150
181.. code-block:: console 151.. code-block:: console
182 152
183 $ vim config/instances.yaml 153 source ~/devstack/openrc admin demo
184 154 openstack network create --provider-network-type vlan --provider-segment 3 --provider-physical-network vhost net
185Example config: 155 openstack subnet create --network net --subnet-range 192.168.1.0/24 --dhcp subnet
156 openstack security group create secgroup
157 openstack security group rule create --ingress --protocol icmp secgroup
158 openstack security group rule create --ingress --protocol tcp secgroup
159 openstack server create --flavor cirros256 --image cirros-0.3.4-x86_64-uec --nic net-id=net --security-group secgroup \
160 --availability-zone nova:contrail-node.novalocal instance
186 161
187.. code-block:: yaml 162Created VM could be accessed by VNC (through horizon):
188 163
189 provider_config: 1641. Go to horizon's list of VMs http://10.100.0.3/dashboard/project/instances/
190 bms:
191 instances:
192 bms1:
193 provider: bms
194 ip: 10.100.0.2
195 contrail_configuration:
196 CONTAINER_REGISTRY: opencontrailnightly
197 CONTRAIL_VERSION: latest
198 CONTROLLER_NODES: 192.168.0.2 # contrail node internal IP
199 CLOUD_ORCHESTRATOR: openstack
200 AUTH_MODE: keystone
201 KEYSTONE_AUTH_ADMIN_PASSWORD: admin
202 KEYSTONE_AUTH_HOST: 192.168.0.3 # openstack node internal IP
203 RABBITMQ_NODE_PORT: 5673
204 PHYSICAL_INTERFACE: eth1
205 VROUTER_GATEWAY: 192.168.0.1
206
207**4. Run ansible playbook**
208 165
209.. code-block:: console 1662. Enter into the VM's console.
167 - If the console does not response, click the link "Click here to show only console".
168 - If you see black console, press enter to attach.
210 169
211 $ ansible-playbook -i inventory/ playbooks/configure_instances.yml 1703. Login into. Default login/password is ``cirros/cubswin:)``
212 $ ansible-playbook -i inventory/ -e orchestrator=openstack playbooks/install_contrail.yml
diff --git a/playbooks/contrail.yml b/playbooks/contrail.yml
deleted file mode 100644
index e319796..0000000
--- a/playbooks/contrail.yml
+++ /dev/null
@@ -1,10 +0,0 @@
1---
2# Install Contrail (with use of devstack), do not enable any services yet
3
4- hosts: contrail
5 gather_facts: no
6 become: no
7 roles:
8 - { role: fetch_devstack, vm_group: contrail }
9 - { role: contrail_vm }
10
diff --git a/playbooks/deploy_driver.yml b/playbooks/deploy_driver.yml
deleted file mode 100644
index bdf1a64..0000000
--- a/playbooks/deploy_driver.yml
+++ /dev/null
@@ -1,9 +0,0 @@
1---
2
3- hosts: contrail
4 gather_facts: no
5 become: no
6 roles:
7 - { role: restack_contrail }
8 - { role: source_openrc }
9
diff --git a/playbooks/env.yml b/playbooks/env.yml
deleted file mode 100644
index 9000380..0000000
--- a/playbooks/env.yml
+++ /dev/null
@@ -1,11 +0,0 @@
1---
2# Deploy two-node environment: Contrail node and OpenStack node
3
4- include: prepare.yml
5
6- include: contrail.yml
7
8- include: openstack.yml
9
10- include: deploy_driver.yml
11
diff --git a/playbooks/group_vars/all.yml b/playbooks/group_vars/all.yml
index 1bff6e5..30990b7 100644
--- a/playbooks/group_vars/all.yml
+++ b/playbooks/group_vars/all.yml
@@ -1,30 +1,19 @@
1--- 1---
2# Note: Unused variables should be commented! 2# IP address for OpenConrail (e.g. 192.168.0.2)
3contrail_ip:
3 4
4# [Optional] Multihost installation with compute node and OpenStack controller on different VMs. Default value True. 5# Gateway address for OpenConrail (e.g. 192.168.0.1)
5#multihost: True 6contrail_gateway:
6 7
7# [Optional] Do not create initial project networks by Neutron. Default value False. 8# Interface name for OpenConrail (e.g. eth0)
8#create_initial_networks: False 9contrail_interface:
9 10
10# [Optional] If service_token not specified default 'token' will be used.
11#service_token:
12# [Optional] If password not specified default 'admin' will be used.
13#admin_pass:
14 11
15# [Required] IP address for OpenConrail VM. 12# IP address for Openstack VM (e.g. 192.168.0.3)
16contrail_ip:
17# [Required] IP address for Openstack VM.
18openstack_ip: 13openstack_ip:
19 14
20# [Optional] If not specified default value 8082 will be used. 15# Openstack branch used on VMs.
21#contrail_port: 8082 16openstack_branch: stable/ocata
22
23# [Required] Openstack branch used on VMs.
24openstack_branch:
25# [Required] OpenContrail branch to build on VM.
26contrail_branch:
27 17
28# [Required] Kernel version supported by OpenContrail branch. This must be a part of package name 18# If true, then install networking_bgpvpn plugin with contrail driver
29# for example to use ubuntu 14.0.4 linux-image-3.13.0-77-generic package you should enter 3.13.0-77 here 19install_networking_bgpvpn_plugin: false
30kernel_version:
diff --git a/playbooks/hosts b/playbooks/hosts
index a018792..50d5e6d 100644
--- a/playbooks/hosts
+++ b/playbooks/hosts
@@ -1,5 +1,4 @@
1[contrail] 1controller ansible_host=openstack-node ansible_user=ubuntu
2contrail-node
3 2
4[openstack] 3[compute]
5openstack-node 4contrail-node ansible_user=centos
diff --git a/playbooks/main.yml b/playbooks/main.yml
index 90056ac..b1befda 100755
--- a/playbooks/main.yml
+++ b/playbooks/main.yml
@@ -1,3 +1,17 @@
1#!/usr/bin/env ansible-playbook 1#!/usr/bin/env ansible-playbook
2 2
3- include: env.yml 3- hosts: controller
4 roles:
5 - devstack_controller_node
6 - restack_controller_node
7- hosts: compute
8 roles:
9 - contrail_node
10- hosts: controller
11 roles:
12 - { role: networking_bgpvpn_plugin, when: install_networking_bgpvpn_plugin }
13 - { role: restack_controller_node, when: install_networking_bgpvpn_plugin }
14- hosts: compute
15 roles:
16 - devstack_compute_node
17 - restack_compute_node
diff --git a/playbooks/openstack.yml b/playbooks/openstack.yml
deleted file mode 100644
index 7e5f8b3..0000000
--- a/playbooks/openstack.yml
+++ /dev/null
@@ -1,11 +0,0 @@
1---
2# Install OpenStack (via devstack)
3
4- hosts: openstack
5 gather_facts: no
6 become: no
7 roles:
8 - { role: fetch_devstack, vm_group: openstack }
9 - { role: openstack_vm }
10 - { role: source_openrc }
11
diff --git a/playbooks/prepare.yml b/playbooks/prepare.yml
deleted file mode 100644
index dde1501..0000000
--- a/playbooks/prepare.yml
+++ /dev/null
@@ -1,8 +0,0 @@
1---
2# One time hosts preparation
3
4- hosts: contrail openstack
5 gather_facts: yes
6 become: no
7 roles:
8 - { role: common }
diff --git a/playbooks/roles/common/defaults/main.yml b/playbooks/roles/common/defaults/main.yml
deleted file mode 100644
index f32565e..0000000
--- a/playbooks/roles/common/defaults/main.yml
+++ /dev/null
@@ -1,11 +0,0 @@
1---
2# default nameserver
3nameserver: 8.8.8.8
4
5# default variables values for VMs
6multihost: True
7create_initial_networks: False
8service_token: token
9admin_pass: admin
10# default OpenContrail API port number
11contrail_port: 8082
diff --git a/playbooks/roles/common/tasks/check_variables.yml b/playbooks/roles/common/tasks/check_variables.yml
deleted file mode 100644
index 7fe8c14..0000000
--- a/playbooks/roles/common/tasks/check_variables.yml
+++ /dev/null
@@ -1,27 +0,0 @@
1---
2# check for not specified variables from group_vars/all.yml
3
4- fail:
5 msg: "contrail_ip: Please check group_vars/all.yml if all required vars were set."
6 when: not contrail_ip | ipv4
7 tags: check
8
9- fail:
10 msg: "openstack_ip: Please check group_vars/all.yml if all required vars were set."
11 when: not openstack_ip | ipv4
12 tags: check
13
14- fail:
15 msg: "openstack_branch: Please check group_vars/all.yml if all required vars were set."
16 when: not openstack_branch | mandatory
17 tags: check
18
19- fail:
20 msg: "contrail_branch: Please check group_vars/all.yml if all required vars were set."
21 when: not contrail_branch | mandatory
22 tags: check
23
24- fail:
25 msg: "kernel_version: Please check group_vars/all.yml if all required vars were set."
26 when: not kernel_version | mandatory
27 tags: check
diff --git a/playbooks/roles/common/tasks/dependencies.yml b/playbooks/roles/common/tasks/dependencies.yml
deleted file mode 100644
index c57da0e..0000000
--- a/playbooks/roles/common/tasks/dependencies.yml
+++ /dev/null
@@ -1,33 +0,0 @@
1---
2# install required dependencies
3- name: install python-apt
4 command: apt install {{ item }} -y
5 with_items:
6 - "python-apt"
7 - "libsasl2-dev"
8 become: yes
9
10- name: install git, pip, setuptools & python-dev
11 apt:
12 name: "{{ item }}"
13 update_cache: yes
14 cache_valid_time: 3600
15 with_items:
16 - "git"
17 - "python-setuptools"
18 - "python-pip"
19 - "python-dev"
20 become: yes
21
22- name: (hack) install devstack dependencies those will be replaced later with devstack requirements.txt
23 pip:
24 name: "{{ item }}"
25 become: yes
26 with_items:
27 - 'pytz'
28 - 'iso8601'
29 - 'cmd2'
30 - 'netifaces'
31 - 'monotonic'
32 - 'wrapt'
33 - 'rfc3986'
diff --git a/playbooks/roles/common/tasks/hostname.yml b/playbooks/roles/common/tasks/hostname.yml
deleted file mode 100644
index 43684b7..0000000
--- a/playbooks/roles/common/tasks/hostname.yml
+++ /dev/null
@@ -1,10 +0,0 @@
1---
2# Add hostname to /etc/hosts
3
4- name: adding hostname to /etc/hosts
5 lineinfile:
6 dest: /etc/hosts
7 regexp: '^127\.0\.1\.1'
8 line: '127.0.1.1 {{ ansible_hostname }}'
9 state: present
10 become: yes
diff --git a/playbooks/roles/common/tasks/main.yml b/playbooks/roles/common/tasks/main.yml
deleted file mode 100644
index 8c157c1..0000000
--- a/playbooks/roles/common/tasks/main.yml
+++ /dev/null
@@ -1,9 +0,0 @@
1---
2# Playbook initialize VM for further installation steps
3
4- include: hostname.yml
5- include: check_variables.yml
6- include: ubuntu_xenial.yml
7- include: ssh_keys.yml
8- include: nameserver.yml
9- include: dependencies.yml
diff --git a/playbooks/roles/common/tasks/nameserver.yml b/playbooks/roles/common/tasks/nameserver.yml
deleted file mode 100644
index 76e7f7e..0000000
--- a/playbooks/roles/common/tasks/nameserver.yml
+++ /dev/null
@@ -1,17 +0,0 @@
1---
2# configure nameserver in VM
3- name: configure nameserver
4 lineinfile:
5 dest: /etc/dhcp/dhclient.conf
6 insertafter: '^#prepend domain-name-servers'
7 line: 'supersede domain-name-servers {{ nameserver }};'
8 state: present
9 become: yes
10
11- name: update resolv.conf
12 lineinfile:
13 dest: /etc/resolv.conf
14 regexp: '^nameserver .*'
15 line: 'nameserver {{ nameserver }}'
16 state: present
17 become: yes
diff --git a/playbooks/roles/common/tasks/ssh_keys.yml b/playbooks/roles/common/tasks/ssh_keys.yml
deleted file mode 100644
index 2964a9d..0000000
--- a/playbooks/roles/common/tasks/ssh_keys.yml
+++ /dev/null
@@ -1,7 +0,0 @@
1---
2# install ssh keys on VM
3- name: install ssh key on VM
4 authorized_key: user=ubuntu
5 key={{ lookup('file', '~/.ssh/id_rsa.pub') }}
6 state=present
7 become: no
diff --git a/playbooks/roles/common/tasks/ubuntu_xenial.yml b/playbooks/roles/common/tasks/ubuntu_xenial.yml
deleted file mode 100644
index f30de24..0000000
--- a/playbooks/roles/common/tasks/ubuntu_xenial.yml
+++ /dev/null
@@ -1,10 +0,0 @@
1---
2# install prerequisite for xenial
3
4- name: setup nameserver before installing python
5 raw: 'sed -i_bak "s/\(nameserver\) .*/\1 8\.8\.8\.8/" /etc/resolv.conf'
6 become: yes
7
8- name: install python 2.7 required by ansible
9 raw: 'apt-get update && apt install -y python'
10 become: yes
diff --git a/playbooks/roles/common/vars/main.yml b/playbooks/roles/common/vars/main.yml
deleted file mode 100644
index fa3a921..0000000
--- a/playbooks/roles/common/vars/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
1---
2# override default nameserver
3
4# nameserver: 8.8.8.8
diff --git a/playbooks/roles/contrail_node/tasks/contrail.yml b/playbooks/roles/contrail_node/tasks/contrail.yml
new file mode 100644
index 0000000..7f32b36
--- /dev/null
+++ b/playbooks/roles/contrail_node/tasks/contrail.yml
@@ -0,0 +1,128 @@
1---
2- name: Install required utilities
3 become: yes
4 yum:
5 name: "{{ item }}"
6 state: present
7 with_items:
8 - python-devel
9 - epel-release
10 - gcc
11 - git
12 - ansible-2.4.*
13 - yum-utils
14
15- name: Install pip
16 become: yes
17 yum:
18 name: python-pip
19 state: present
20
21- name: Add docker-ce repository
22 become: yes
23 shell: |
24 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
25
26- name: Install docker
27 become: yes
28 yum:
29 name: docker-ce
30 state: present
31
32- name: Start docker daemon
33 become: yes
34 service:
35 name: docker
36 state: running
37 enabled: yes
38
39- name: Add user to docker group
40 become: yes
41 user:
42 name: centos
43 groups: docker
44 append: yes
45
46- name: install docker and docker-compose for python
47 pip:
48 name: "{{ item }}"
49 state: present
50 extra_args: --user
51 with_items:
52 - docker-py==1.10.6
53 - docker-compose==1.9.0
54
55# Dirty ugly workaround on contrail-ansible-deployer not using 'become' in playbooks
56- name: Create directories for contrail
57 shell: |
58 set -e
59 set -x
60 sudo mkdir -p /var/log/contrail
61 sudo mkdir -p /etc/contrail
62 sudo chmod 777 /var/log/contrail /etc/contrail
63
64# Contrail Ansible Deployer
65- name: Create ssh key and add to authorized_key for centos user
66 shell: |
67 set -e
68 set -x
69 yes | ssh-keygen -t rsa -N '' -f ~/.ssh/centos_rsa
70 cat ~/.ssh/centos_rsa.pub | tee --append ~/.ssh/authorized_keys
71 chmod 700 ~/.ssh
72 chmod 600 ~/.ssh/centos_rsa ~/.ssh/authorized_keys
73
74- name: Clone 'contrail-ansible-deployer' repository
75 git:
76 clone: yes
77 force: yes
78 dest: ~/contrail-ansible-deployer
79 repo: https://github.com/Juniper/contrail-ansible-deployer.git
80
81- name: Checkout 'contrail-ansible-deployer' repository
82 shell: |
83 cd ~/contrail-ansible-deployer
84 git checkout 38a0b84ec7a5f4c2a1b8b8c9c36b007dc8477b1f
85
86- name: Update hosts file
87 template:
88 src: hosts.j2
89 dest: ~/contrail-ansible-deployer/inventory/hosts
90
91- name: Update instances.yaml file
92 template:
93 src: instances.yaml.j2
94 dest: ~/contrail-ansible-deployer/config/instances.yaml
95
96- name: Provision Node before deploy contrail
97 shell: |
98 set -e
99 set -x
100 cd ~/contrail-ansible-deployer/
101 ansible-playbook -vv \
102 -e skip_openstack=true \
103 -e config_file=~/contrail-ansible-deployer/config/instances.yaml \
104 -i inventory/ playbooks/configure_instances.yml
105
106- name: Deploy OpenContrail
107 shell: |
108 set -e
109 set -x
110 cd ~/contrail-ansible-deployer/
111 ansible-playbook -vv \
112 -e skip_openstack=true \
113 -e config_file=~/contrail-ansible-deployer/config/instances.yaml \
114 -e '{"CREATE_CONTAINERS":true}' \
115 -e orchestrator=none \
116 -i inventory/ playbooks/install_contrail.yml
117
118- name: Wait for contrail until fully running
119 wait_for:
120 sleep: 5
121 host: "{{ contrail_ip }}"
122 port: 8082
123 timeout: 300
124
125- name: Copy vrouter
126 become: yes
127 shell: |
128 docker cp vrouter_vrouter-agent_1:/usr/bin/vrouter-port-control /usr/bin/
diff --git a/playbooks/roles/contrail_node/tasks/main.yml b/playbooks/roles/contrail_node/tasks/main.yml
new file mode 100644
index 0000000..e8ee2ba
--- /dev/null
+++ b/playbooks/roles/contrail_node/tasks/main.yml
@@ -0,0 +1,3 @@
1---
2- include: update_kernel.yml
3- include: contrail.yml
diff --git a/playbooks/roles/contrail_node/tasks/update_kernel.yml b/playbooks/roles/contrail_node/tasks/update_kernel.yml
new file mode 100644
index 0000000..8948e9b
--- /dev/null
+++ b/playbooks/roles/contrail_node/tasks/update_kernel.yml
@@ -0,0 +1,19 @@
1---
2- name: update kernel
3 become: yes
4 yum:
5 name: kernel
6 state: latest
7 register: update_kernel
8
9- name: Reboot the machine
10 become: yes
11 shell: nohup bash -c "sleep 2s && shutdown -r now" &
12 when: update_kernel.changed
13 register: reboot_machine
14
15- name: Wait for machine to come back
16 wait_for_connection:
17 timeout: 240
18 delay: 10
19 when: reboot_machine.changed
diff --git a/playbooks/roles/contrail_node/templates/hosts.j2 b/playbooks/roles/contrail_node/templates/hosts.j2
new file mode 100644
index 0000000..115b624
--- /dev/null
+++ b/playbooks/roles/contrail_node/templates/hosts.j2
@@ -0,0 +1,4 @@
1container_hosts:
2 hosts:
3 {{ contrail_ip }}:
4 ansible_user: centos
diff --git a/playbooks/roles/contrail_node/templates/instances.yaml.j2 b/playbooks/roles/contrail_node/templates/instances.yaml.j2
new file mode 100644
index 0000000..9ba7c3c
--- /dev/null
+++ b/playbooks/roles/contrail_node/templates/instances.yaml.j2
@@ -0,0 +1,50 @@
1provider_config:
2 bms:
3 ssh_user: centos
4 ssh_public_key: ~/.ssh/centos_rsa.pub
5 ssh_private_key: ~/.ssh/centos_rsa
6 ntpserver: 0.pool.ntp.org
7 nameserer: 8.8.8.8
8
9instances:
10 bms1:
11 provider: bms
12 ip: {{ contrail_ip }}
13 roles:
14 config_database:
15 config:
16 control:
17 webui:
18 vrouter:
19 openstack:
20 openstack_compute:
21
22global_configuration:
23 CONTAINER_REGISTRY: opencontrailnightly
24
25contrail_configuration:
26 CONTRAIL_VERSION: ocata-master-105
27 CLOUD_ORCHESTRATOR: None
28 LOG_LEVEL: SYS_DEBUG
29 AAA_MODE: no-auth
30 VROUTER_GATEWAY: {{ contrail_gateway }}
31 PHYSICAL_INTERFACE: {{ contrail_interface }}
32 AUTH_MODE: keystone
33 KEYSTONE_AUTH_ADMIN_PASSWORD: admin
34 KEYSTONE_AUTH_HOST: {{ openstack_ip }}
35 KEYSTONE_AUTH_URL_VERSION: /identity/v3
36 KEYSTONE_AUTH_URL_TOKENS: /identity/v3/auth/tokens
37 KEYSTONE_AUTH_INSECURE: true
38 KEYSTONE_AUTH_ADMIN_PORT: 80
39 KEYSTONE_AUTH_PUBLIC_PORT: 80
40 RABBITMQ_NODE_PORT: 5673
41 UPDATE_IMAGES: true
42 UPGRADE_KERNEL: true
43 CONTROLLER_NODES: {{ contrail_ip }}
44 CONTROL_NODES: {{ contrail_ip }}
45 WEBUI_NODES: {{ contrail_ip }}
46 CONFIGDB_NODES: {{ contrail_ip }}
47 CONFIG_NODES: {{ contrail_ip }}
48 CONFIG_NODEMGR__DEFAULTS__minimum_diskGB: 2
49 DATABASE_NODEMGR__DEFAULTS__minimum_diskGB: 2
50 JVM_EXTRA_OPTS: "-Xms1g -Xmx2g"
diff --git a/playbooks/roles/contrail_vm/files/Analytics-SConscript.patch b/playbooks/roles/contrail_vm/files/Analytics-SConscript.patch
deleted file mode 100644
index 6a2877e..0000000
--- a/playbooks/roles/contrail_vm/files/Analytics-SConscript.patch
+++ /dev/null
@@ -1,10 +0,0 @@
1--- controller/src/analytics/SConscript-orig 2017-08-22 14:24:31.000000000 +0000
2+++ controller/src/analytics/SConscript 2017-08-28 13:50:22.405913015 +0000
3@@ -58,6 +58,7 @@
4 'zookeeper_client',
5 'zookeeper_mt',
6 'ssl',
7+ 'sasl2',
8 'crypto',
9 'boost_filesystem',
10 'boost_program_options',
diff --git a/playbooks/roles/contrail_vm/files/contrail_config.patch b/playbooks/roles/contrail_vm/files/contrail_config.patch
deleted file mode 100644
index 307901a..0000000
--- a/playbooks/roles/contrail_vm/files/contrail_config.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1--- /opt/stack/contrail/devstack/lib/contrail_config 2017-07-27 09:12:11.603603000 +0000
2+++ /home/ubuntu/contrail_plugin_zioc/contrail_config.new 2017-07-28 07:25:46.151703981 +0000
3@@ -340,6 +340,35 @@
4 iniset -sudo $config_file DEFAULT log_local 1
5 }
6
7+function contrail_config_alarm_gen()
8+{
9+ local config_file="/etc/contrail/contrail-alarm-gen.conf"
10+ sudo truncate -s 0 $config_file
11+
12+ [[ -n $CLUSTER_ID ]] && iniset -sudo $config_file DATABASE cluster_id $CLUSTER_ID
13+
14+ iniset -sudo $config_file DEFAULT host_ip $COLLECTOR_IP
15+
16+ #REVISIT: analytics api currently fails with default value (15)
17+ iniset -sudo $config_file DEFAULT partitions 0
18+
19+ if _vercmp $CONTRAIL_BRANCH "<" R3.0; then
20+ iniset -sudo $config_file DEFAULT cassandra_server_list "$CASSANDRA_IP_PORT_LIST"
21+ else
22+ iniset -sudo $config_file DEFAULT cassandra_server_list "$CASSANDRA_CQL_IP_PORT_LIST"
23+ fi
24+
25+ if _vercmp $CONTRAIL_BRANCH "<" R4.0; then
26+ iniset -sudo $config_file DISCOVERY disc_server_ip $DISCOVERY_IP
27+ iniset -sudo $config_file DISCOVERY disc_server_port 5998
28+ else
29+ iniset -sudo $config_file DEFAULT collectors "$COLLECTOR_IP_PORT_LIST"
30+ fi
31+
32+ iniset -sudo $config_file DEFAULT log_level 'SYS_DEBUG'
33+ iniset -sudo $config_file DEFAULT log_local 1
34+}
35+
36 function contrail_config_query()
37 {
38 local config_file="/etc/contrail/contrail-query-engine.conf"
diff --git a/playbooks/roles/contrail_vm/files/contrail_patches b/playbooks/roles/contrail_vm/files/contrail_patches
deleted file mode 100644
index 5cf5de1..0000000
--- a/playbooks/roles/contrail_vm/files/contrail_patches
+++ /dev/null
@@ -1,4 +0,0 @@
1patch $CONTRAIL_DEST/devstack/plugin.sh < plugin.patch
2patch $CONTRAIL_DEST/devstack/plugin.sh < contrail_plugin_diff.patch
3patch $CONTRAIL_DEST/devstack/lib/contrail_config < contrail_config.patch
4patch $CONTRAIL_DEST/controller/src/analytics/SConscript < Analytics-SConscript.patch
diff --git a/playbooks/roles/contrail_vm/files/contrail_plugin_diff.patch b/playbooks/roles/contrail_vm/files/contrail_plugin_diff.patch
deleted file mode 100644
index 5901d35..0000000
--- a/playbooks/roles/contrail_vm/files/contrail_plugin_diff.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1--- /opt/stack/contrail/devstack/plugin.sh.orig 2018-01-12 11:52:36.534751974 +0000
2+++ /opt/stack/contrail/devstack/plugin.sh 2018-01-12 12:15:53.605687810 +0000
3@@ -166,21 +166,21 @@
4 [ ! -d /var/log/contrail ] && sudo mkdir /var/log/contrail
5 sudo chmod 777 /var/log/contrail
6
7- run_process vrouter "sudo contrail-vrouter-agent --config_file=/etc/contrail/contrail-vrouter-agent.conf"
8- run_process api-srv "contrail-api --conf_file /etc/contrail/contrail-api.conf"
9+ run_process vrouter "/usr/bin/contrail-vrouter-agent --config_file=/etc/contrail/contrail-vrouter-agent.conf" ubuntu root
10+ run_process api-srv "/usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf"
11 # Wait for api to be ready, as it creates cassandra CF required for disco to start
12 is_service_enabled disco && is_service_enabled api-srv && wget --no-proxy --retry-connrefused --no-check-certificate --waitretry=1 -t 60 -q -O /dev/null http://$APISERVER_IP:8082 || true
13- run_process disco "contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf"
14- run_process svc-mon "contrail-svc-monitor --conf_file /etc/contrail/contrail-svc-monitor.conf"
15- run_process schema "contrail-schema --conf_file /etc/contrail/contrail-schema.conf"
16- run_process control "sudo contrail-control --conf_file /etc/contrail/contrail-control.conf"
17- run_process collector "contrail-collector --conf_file /etc/contrail/contrail-collector.conf"
18- run_process analytic-api "contrail-analytics-api --conf_file /etc/contrail/contrail-analytics-api.conf"
19+ #run_process disco "contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf"
20+ run_process svc-mon "/usr/bin/contrail-svc-monitor --conf_file /etc/contrail/contrail-svc-monitor.conf"
21+ run_process schema "/usr/bin/contrail-schema --conf_file /etc/contrail/contrail-schema.conf"
22+ run_process control "/usr/bin/contrail-control --conf_file /etc/contrail/contrail-control.conf" ubuntu root
23+ run_process collector "/usr/bin/contrail-collector --conf_file /etc/contrail/contrail-collector.conf"
24+ run_process analytic-api "/usr/bin/contrail-analytics-api --conf_file /etc/contrail/contrail-analytics-api.conf"
25 run_process alarm-gen "/usr/bin/contrail-alarm-gen --conf_file /etc/contrail/contrail-alarm-gen.conf"
26- run_process query-engine "contrail-query-engine --conf_file /etc/contrail/contrail-query-engine.conf"
27- run_process dns "contrail-dns --conf_file /etc/contrail/dns/contrail-dns.conf"
28+ run_process query-engine "/usr/bin/contrail-query-engine --conf_file /etc/contrail/contrail-query-engine.conf"
29+ run_process dns "/usr/bin/contrail-dns --conf_file /etc/contrail/dns/contrail-dns.conf"
30 #NOTE: contrail-dns checks for '/usr/bin/contrail-named' in /proc/[pid]/cmdline to retrieve bind status
31- run_process named "sudo /usr/bin/contrail-named -g -c /etc/contrail/dns/contrail-named.conf"
32+ run_process named "/usr/bin/contrail-named -g -c /etc/contrail/dns/contrail-named.conf -u ubuntu" ubuntu root
33
34 run_process ui-jobs "cd $CONTRAIL_DEST/contrail-web-core; sudo nodejs jobServerStart.js"
35 run_process ui-webs "cd $CONTRAIL_DEST/contrail-web-core; sudo nodejs webServerStart.js"
diff --git a/playbooks/roles/contrail_vm/files/plugin.patch b/playbooks/roles/contrail_vm/files/plugin.patch
deleted file mode 100644
index 25582d1..0000000
--- a/playbooks/roles/contrail_vm/files/plugin.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1--- /opt/stack/contrail/devstack/plugin.sh 2017-07-28 11:24:23.565728545 +0000
2+++ /home/ubuntu/contrail_plugin_zioc/plugin.sh.new 2017-07-28 11:29:49.693737003 +0000
3@@ -62,11 +62,11 @@
4 echo "Installing cassanadra CPP drivers"
5 TMP_PKG_DIR=$(mktemp -d)
6 cd $TMP_PKG_DIR
7-
8+
9 wget http://downloads.datastax.com/cpp-driver/ubuntu/$os_RELEASE/cassandra/v2.5.0/cassandra-cpp-driver_2.5.0-1_amd64.deb
10 wget http://downloads.datastax.com/cpp-driver/ubuntu/$os_RELEASE/cassandra/v2.5.0/cassandra-cpp-driver-dev_2.5.0-1_amd64.deb
11 wget http://downloads.datastax.com/cpp-driver/ubuntu/$os_RELEASE/dependencies/libuv/v1.8.0/libuv_1.8.0-1_amd64.deb
12-
13+
14 sudo dpkg -i *.deb
15
16 cd $TOP_DIR
17@@ -176,6 +176,7 @@
18 run_process control "sudo contrail-control --conf_file /etc/contrail/contrail-control.conf"
19 run_process collector "contrail-collector --conf_file /etc/contrail/contrail-collector.conf"
20 run_process analytic-api "contrail-analytics-api --conf_file /etc/contrail/contrail-analytics-api.conf"
21+ run_process alarm-gen "/usr/bin/contrail-alarm-gen --conf_file /etc/contrail/contrail-alarm-gen.conf"
22 run_process query-engine "contrail-query-engine --conf_file /etc/contrail/contrail-query-engine.conf"
23 run_process dns "contrail-dns --conf_file /etc/contrail/dns/contrail-dns.conf"
24 #NOTE: contrail-dns checks for '/usr/bin/contrail-named' in /proc/[pid]/cmdline to retrieve bind status
25@@ -183,7 +184,6 @@
26
27 run_process ui-jobs "cd $CONTRAIL_DEST/contrail-web-core; sudo nodejs jobServerStart.js"
28 run_process ui-webs "cd $CONTRAIL_DEST/contrail-web-core; sudo nodejs webServerStart.js"
29-
30 SCREEN_NAME="$STACK_SCREEN_NAME"
31 }
32
33@@ -372,7 +372,7 @@
34
35 echo_summary "Provisionning contrail"
36
37- local provision_api_args="--api_server_ip $SERVICE_HOST --api_server_port 8082 \
38+ local provision_api_args="--api_server_ip $APISERVER_IP --api_server_port 8082 \
39 --admin_user $CONTRAIL_ADMIN_USER --admin_password $CONTRAIL_ADMIN_PASSWORD --admin_tenant_name $CONTRAIL_ADMIN_PROJECT"
40
41 if is_service_enabled vrouter ; then
diff --git a/playbooks/roles/contrail_vm/meta/main.yml b/playbooks/roles/contrail_vm/meta/main.yml
deleted file mode 100644
index 9465c86..0000000
--- a/playbooks/roles/contrail_vm/meta/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
1---
2dependencies:
3 - { role: common }
4 - { role: fetch_devstack, vm_group: contrail }
diff --git a/playbooks/roles/contrail_vm/tasks/contrail_patches.yml b/playbooks/roles/contrail_vm/tasks/contrail_patches.yml
deleted file mode 100644
index 0ee11c1..0000000
--- a/playbooks/roles/contrail_vm/tasks/contrail_patches.yml
+++ /dev/null
@@ -1,26 +0,0 @@
1---
2# copy set of patches used to setup Contrail VM
3- name: copy contrail_patches
4 copy:
5 src: ../files/contrail_patches
6 dest: ~/devstack/contrail_patches
7
8- name: copy plugin.patch
9 copy:
10 src: ../files/plugin.patch
11 dest: ~/devstack/plugin.patch
12
13- name: copy contrail_plugin_diff.patch
14 copy:
15 src: ../files/contrail_plugin_diff.patch
16 dest: ~/devstack/contrail_plugin_diff.patch
17
18- name: copy contrail_config.patch
19 copy:
20 src: ../files/contrail_config.patch
21 dest: ~/devstack/contrail_config.patch
22
23- name: Copy Analytisc SConscript Patch
24 copy:
25 src: ../files/Analytics-SConscript.patch
26 dest: ~/devstack/Analytics-SConscript.patch
diff --git a/playbooks/roles/contrail_vm/tasks/dependencies.yml b/playbooks/roles/contrail_vm/tasks/dependencies.yml
deleted file mode 100644
index bb571b1..0000000
--- a/playbooks/roles/contrail_vm/tasks/dependencies.yml
+++ /dev/null
@@ -1,20 +0,0 @@
1---
2# copy set of patches used to setup Contrail VM
3- name: install fixtures
4 pip:
5 name: "{{ item }}"
6 become: yes
7 become_method: sudo
8 with_items:
9 - 'fixtures'
10
11- name: Install build dependencies
12 apt:
13 name: "{{ item }}"
14 become: yes
15 become_method: sudo
16 with_items:
17 - 'libvirt-bin'
18 - 'qemu-kvm'
19 - 'libcrypto++-dev'
20 - 'libboost-thread1.58-dev'
diff --git a/playbooks/roles/contrail_vm/tasks/kernel.yml b/playbooks/roles/contrail_vm/tasks/kernel.yml
deleted file mode 100644
index 98ef05e..0000000
--- a/playbooks/roles/contrail_vm/tasks/kernel.yml
+++ /dev/null
@@ -1,30 +0,0 @@
1---
2# install supported kernel version
3- name: 'install supported kernel version {{ kernel_version }}'
4 apt:
5 name: "{{ item }}"
6 update_cache: yes
7 cache_valid_time: 3600
8 with_items:
9 - "linux-image-{{ kernel_version }}-generic"
10 - "linux-headers-{{ kernel_version }}-generic"
11 become: yes
12 register: kernel_install
13
14# reboot VM
15- name: reboot VM to boot with newly installed kernel
16 command: shutdown -r now "Ansible updates triggered" removes=/var/run/reboot-required
17 async: 0
18 poll: 0
19 become: yes
20 become_method: sudo
21 when: kernel_install | changed
22 register: restarted
23
24- name: wait for SSH on VM
25 local_action: shell ssh {{ inventory_hostname }} true
26 register: result
27 until: result | success
28 retries: 30
29 delay: 10
30 when: restarted | changed
diff --git a/playbooks/roles/contrail_vm/tasks/main.yml b/playbooks/roles/contrail_vm/tasks/main.yml
deleted file mode 100644
index b3dfe8e..0000000
--- a/playbooks/roles/contrail_vm/tasks/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
1---
2# Setting up OpenContrail VM with Contrail service DISABLED
3
4- include: kernel.yml
5- include: dependencies.yml
6- include: contrail_patches.yml
7- include: stack_sh.yml
diff --git a/playbooks/roles/contrail_vm/tasks/stack_sh.yml b/playbooks/roles/contrail_vm/tasks/stack_sh.yml
deleted file mode 100644
index 987ebad..0000000
--- a/playbooks/roles/contrail_vm/tasks/stack_sh.yml
+++ /dev/null
@@ -1,18 +0,0 @@
1---
2# Run stack.sh in case if it is already running, unstack first
3
4- name: optionally unstack
5 shell: screen -ls | grep stack && ./unstack.sh
6 args:
7 chdir: ~/devstack
8 ignore_errors: yes
9
10- name: build OpenContrail via stack.sh
11 shell: ./stack.sh
12 args:
13 chdir: ~/devstack
14 register: task_result
15 until: task_result.rc == 0
16 retries: 3
17 delay: 1
18 ignore_errors: yes
diff --git a/playbooks/roles/devstack_compute_node/tasks/main.yml b/playbooks/roles/devstack_compute_node/tasks/main.yml
new file mode 100644
index 0000000..7bdce75
--- /dev/null
+++ b/playbooks/roles/devstack_compute_node/tasks/main.yml
@@ -0,0 +1,41 @@
1---
2- name: Install required utilities
3 become: yes
4 yum:
5 name: "{{ item }}"
6 state: present
7 with_items:
8 - lvm2
9 - git
10
11- name: Fetch devstack
12 git:
13 repo: "https://github.com/openstack-dev/devstack.git"
14 dest: ~/devstack
15 version: "{{ openstack_branch }}"
16 accept_hostkey: yes
17 force: yes
18
19- name: Fetch devstack requirements
20 become: yes
21 git:
22 repo: "git://git.openstack.org/openstack/requirements.git"
23 dest: /opt/stack/requirements
24 version: "{{ openstack_branch }}"
25 accept_hostkey: yes
26 force: yes
27
28# If there are any problems with libvirt, then the version of libvirt should be upgraded in devstack requirements.
29#
30# The version of libvirt-python must be the same as, or newer than the version of the libvirt C library you're building against.
31# source: https://www.redhat.com/archives/libvirt-users/2017-September/msg00003.html
32# Since 2018-05-10 the newest libvirt package for centos7 is 3.9.0
33# Alternatively install libvirt 2.5.0 and lock package, so yum can't update it https://www.tecmint.com/yum-lock-disable-blacklist-certain-package-update-version/
34- name: Fix libvirt version
35 become: yes
36 shell: sed -i 's/libvirt-python===2.5.0/libvirt-python===3.9.0/' /opt/stack/requirements/upper-constraints.txt
37
38- name: Put local.conf
39 template:
40 src: compute_local.conf.j2
41 dest: ~/devstack/local.conf
diff --git a/playbooks/roles/devstack_compute_node/templates/compute_local.conf.j2 b/playbooks/roles/devstack_compute_node/templates/compute_local.conf.j2
new file mode 100644
index 0000000..9cba7e4
--- /dev/null
+++ b/playbooks/roles/devstack_compute_node/templates/compute_local.conf.j2
@@ -0,0 +1,36 @@
1[[local|localrc]]
2DEST=/opt/stack
3
4HOST_IP={{ contrail_ip }}
5SERVICE_HOST={{ openstack_ip }}
6MULTI_HOST=1
7
8LOGFILE=$DEST/logs/stack.sh.log
9LOGDAYS=1
10
11ADMIN_PASSWORD=admin
12DATABASE_PASSWORD=$ADMIN_PASSWORD
13RABBIT_PASSWORD=$ADMIN_PASSWORD
14SERVICE_PASSWORD=$ADMIN_PASSWORD
15
16USE_BRANCH={{ openstack_branch }}
17
18NOVA_BRANCH=$USE_BRANCH
19CINDER_BRANCH=$USE_BRANCH
20GLANCE_BRANCH=$USE_BRANCH
21HORIZON_BRANCH=$USE_BRANCH
22KEYSTONE_BRANCH=$USE_BRANCH
23NEUTRON_BRANCH=$USE_BRANCH
24
25MYSQL_HOST=$SERVICE_HOST
26RABBIT_HOST=$SERVICE_HOST
27GLANCE_HOSTPORT=$SERVICE_HOST:9292
28ENABLED_SERVICES=n-cpu,q-agt,n-api-meta,placement-client,q-dhcp
29
30NOVA_VNC_ENABLED=True
31NOVNCPROXY_URL="http://{{ hostvars['controller'].ansible_host }}:6080/vnc_auto.html"
32VNCSERVER_LISTEN=$HOST_IP
33VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN
34
35LOG_COLOR=True
36USE_SCREEN=True
diff --git a/playbooks/roles/fetch_devstack/tasks/fetch_devstack.yml b/playbooks/roles/devstack_controller_node/tasks/main.yml
index 17dfc6b..bf8712c 100644
--- a/playbooks/roles/fetch_devstack/tasks/fetch_devstack.yml
+++ b/playbooks/roles/devstack_controller_node/tasks/main.yml
@@ -1,14 +1,12 @@
1--- 1---
2# Prepare VM to install devstack 2- name: Fetch devstack
3- name: checkout devstack 3 git:
4 git:
5 repo: "https://github.com/openstack-dev/devstack.git" 4 repo: "https://github.com/openstack-dev/devstack.git"
6 dest: ~/devstack 5 dest: ~/devstack
7 version: "{{ openstack_branch }}" 6 version: "{{ openstack_branch }}"
8 accept_hostkey: yes 7 accept_hostkey: yes
9 force: yes 8 force: yes
10 9- name: Put local.conf
11- name: local.conf
12 template: 10 template:
13 src: ../templates/{{ vm_group }}_local.conf.j2 11 src: controller_local.conf.j2
14 dest: ~/devstack/local.conf 12 dest: ~/devstack/local.conf
diff --git a/playbooks/roles/devstack_controller_node/templates/controller_local.conf.j2 b/playbooks/roles/devstack_controller_node/templates/controller_local.conf.j2
new file mode 100644
index 0000000..6e7c105
--- /dev/null
+++ b/playbooks/roles/devstack_controller_node/templates/controller_local.conf.j2
@@ -0,0 +1,54 @@
1[[local|localrc]]
2DEST=/opt/stack
3
4HOST_IP='{{ openstack_ip }}'
5SERVICE_HOST=$HOST_IP
6MULTI_HOST=False
7
8LOGFILE=$DEST/logs/stack.sh.log
9LOGDAYS=1
10
11ADMIN_PASSWORD=admin
12DATABASE_PASSWORD=$ADMIN_PASSWORD
13RABBIT_PASSWORD=$ADMIN_PASSWORD
14SERVICE_PASSWORD=$ADMIN_PASSWORD
15
16USE_BRANCH={{ openstack_branch }}
17
18NOVA_BRANCH=$USE_BRANCH
19CINDER_BRANCH=$USE_BRANCH
20GLANCE_BRANCH=$USE_BRANCH
21HORIZON_BRANCH=$USE_BRANCH
22KEYSTONE_BRANCH=$USE_BRANCH
23NEUTRON_BRANCH=$USE_BRANCH
24
25LOG_COLOR=True
26USE_SCREEN=True
27
28disable_service n-net c-sch c-api c-vol dstat tempest
29
30NEUTRON_CREATE_INITIAL_NETWORKS=False
31
32Q_USE_SECGROUP=True
33Q_PLUGIN=ml2
34
35ML2_L3_PLUGIN=opencontrail-router
36
37OPENCONTRAIL_APISERVER_IP='{{ contrail_ip }}'
38OPENCONTRAIL_APISERVER_PORT=8082
39
40NOVNCPROXY_URL="http://{{ hostvars['controller'].ansible_host }}:6080/vnc_auto.html"
41
42enable_plugin networking-opencontrail https://git.openstack.org/openstack/networking-opencontrail $USE_BRANCH
43
44PHYSICAL_NETWORK=vhost
45TENANT_VLAN_RANGE=1:4094
46Q_ML2_TENANT_NETWORK_TYPE=vlan
47Q_ML2_PLUGIN_MECHANISM_DRIVERS=opencontrail
48
49[[post-config|$NEUTRON_CORE_PLUGIN_CONF]]
50[ml2]
51type_drivers = local,flat,vlan,gre,vxlan,geneve
52tenant_network_types = vlan,vxlan
53mechanism_drivers = opencontrail,openvswitch,linuxbridge
54extension_drivers = port_security
diff --git a/playbooks/roles/fetch_devstack/defaults/main.yml b/playbooks/roles/fetch_devstack/defaults/main.yml
deleted file mode 100644
index f32565e..0000000
--- a/playbooks/roles/fetch_devstack/defaults/main.yml
+++ /dev/null
@@ -1,11 +0,0 @@
1---
2# default nameserver
3nameserver: 8.8.8.8
4
5# default variables values for VMs
6multihost: True
7create_initial_networks: False
8service_token: token
9admin_pass: admin
10# default OpenContrail API port number
11contrail_port: 8082
diff --git a/playbooks/roles/fetch_devstack/meta/main.yml b/playbooks/roles/fetch_devstack/meta/main.yml
deleted file mode 100644
index 6b4fff8..0000000
--- a/playbooks/roles/fetch_devstack/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
1---
2dependencies:
3 - { role: common }
diff --git a/playbooks/roles/fetch_devstack/tasks/main.yml b/playbooks/roles/fetch_devstack/tasks/main.yml
deleted file mode 100644
index c3406da..0000000
--- a/playbooks/roles/fetch_devstack/tasks/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
1---
2# Fetch devstack and prepare configuration in local.conf file
3
4- include: fetch_devstack.yml
diff --git a/playbooks/roles/fetch_devstack/templates/contrail_local.conf.j2 b/playbooks/roles/fetch_devstack/templates/contrail_local.conf.j2
deleted file mode 100644
index ba94b8e..0000000
--- a/playbooks/roles/fetch_devstack/templates/contrail_local.conf.j2
+++ /dev/null
@@ -1,47 +0,0 @@
1# {{ ansible_managed }}
2[[local|localrc]]
3SERVICE_TOKEN={{ service_token }}
4HOST_IP={{ contrail_ip }}
5SERVICE_HOST={{ openstack_ip }}
6MULTI_HOST={{ multihost }}
7LOGFILE=/opt/stack/logs/stack.sh.log
8LOGDAYS=1
9ADMIN_PASSWORD={{ admin_pass }}
10DATABASE_PASSWORD=$ADMIN_PASSWORD
11RABBIT_PASSWORD=$ADMIN_PASSWORD
12SERVICE_PASSWORD=$ADMIN_PASSWORD
13
14#Newton Branches
15NOVA_BRANCH={{ openstack_branch }}
16NEUTRON_BRANCH={{ openstack_branch }}
17
18LOG_COLOR=True
19MYSQL_HOST=$SERVICE_HOST
20RABBIT_HOST=$SERVICE_HOST
21Q_HOST=$SERVICE_HOST
22
23USE_SCREEN=True
24
25# starting from Ocata release placement-api is required
26# and has to be enabled as well
27{% if 'newton' in openstack_branch %}
28ENABLED_SERVICES=nova,neutron,vrouter,api-srv,svc-mon,schema,control,collector,analytic-api,query-engine,dns,named,ui-jobs,ui-webs,alarm-gen
29#ENABLED_SERVICES+=,n-cpu
30{% else %}
31ENABLED_SERVICES=neutron,nova,vrouter,api-srv,svc-mon,schema,control,collector,analytic-api,query-engine,dns,named,ui-jobs,ui-webs,alarm-gen
32#ENABLED_SERVICES+=,n-cpu,placement-api
33{% endif %}
34
35# if OpenContrail release in R3.x enable discovery service
36{% if contrail_branch[1] == '3' %}
37ENABLED_SERVICES+=,disco
38{% endif %}
39
40NEUTRON_CREATE_INITIAL_NETWORKS={{ create_initial_networks }}
41
42CONTRAIL_BRANCH={{ contrail_branch }}
43CONTRAIL_PATCHES='contrail_patches'
44CONFIG_IP=$HOST_IP
45enable_plugin contrail https://github.com/zioc/contrail-devstack-plugin.git
46# Use this with precaution. You have to run multiples time the compilation before it succeed with parallel jobs
47SCONS_JOBS=$(($(lscpu -p | grep -cve '^#')+1))
diff --git a/playbooks/roles/fetch_devstack/templates/openstack_local.conf.j2 b/playbooks/roles/fetch_devstack/templates/openstack_local.conf.j2
deleted file mode 100644
index 837e28a..0000000
--- a/playbooks/roles/fetch_devstack/templates/openstack_local.conf.j2
+++ /dev/null
@@ -1,35 +0,0 @@
1[[local|localrc]]
2SERVICE_TOKEN={{ service_token }}
3HOST_IP={{ openstack_ip }}
4SERVICE_HOST=$HOST_IP
5MULTI_HOST={{ multihost }}
6LOGFILE=/opt/stack/logs/stack.sh.log
7LOGDAYS=1
8ADMIN_PASSWORD={{ admin_pass }}
9DATABASE_PASSWORD=$ADMIN_PASSWORD
10RABBIT_PASSWORD=$ADMIN_PASSWORD
11SERVICE_PASSWORD=$ADMIN_PASSWORD
12
13# OpenStack Branches
14NOVA_BRANCH={{ openstack_branch }}
15CINDER_BRANCH={{ openstack_branch }}
16GLANCE_BRANCH={{ openstack_branch }}
17HORIZON_BRANCH={{ openstack_branch }}
18KEYSTONE_BRANCH={{ openstack_branch }}
19NEUTRON_BRANCH={{ openstack_branch }}
20
21LOG_COLOR=True
22USE_SCREEN=True
23disable_service n-net n-cpu c-sch c-api c-vol q-dhcp q-agt q-l3 dstat tempest
24
25NEUTRON_CREATE_INITIAL_NETWORKS={{ create_initial_networks }}
26Q_USE_SECGROUP=True
27Q_PLUGIN=ml2
28
29ML2_L3_PLUGIN=opencontrail-router
30
31OPENCONTRAIL_APISERVER_IP='{{ contrail_ip }}'
32OPENCONTRAIL_APISERVER_PORT={{ contrail_port }}
33
34enable_plugin networking-opencontrail https://github.com/openstack/networking-opencontrail
35#enable_plugin networking-opencontrail https://github.com/openstack/networking-opencontrail stable/ocata
diff --git a/playbooks/roles/networking_bgpvpn_plugin/files/cfgm_common-0.1.dev0.tar.gz b/playbooks/roles/networking_bgpvpn_plugin/files/cfgm_common-0.1.dev0.tar.gz
new file mode 100644
index 0000000..7174c89
--- /dev/null
+++ b/playbooks/roles/networking_bgpvpn_plugin/files/cfgm_common-0.1.dev0.tar.gz
Binary files differ
diff --git a/playbooks/roles/networking_bgpvpn_plugin/files/vnc_api-5.0.0.tar.gz b/playbooks/roles/networking_bgpvpn_plugin/files/vnc_api-5.0.0.tar.gz
new file mode 100644
index 0000000..4434287
--- /dev/null
+++ b/playbooks/roles/networking_bgpvpn_plugin/files/vnc_api-5.0.0.tar.gz
Binary files differ
diff --git a/playbooks/roles/networking_bgpvpn_plugin/tasks/main.yml b/playbooks/roles/networking_bgpvpn_plugin/tasks/main.yml
new file mode 100644
index 0000000..94fc8c9
--- /dev/null
+++ b/playbooks/roles/networking_bgpvpn_plugin/tasks/main.yml
@@ -0,0 +1,75 @@
1---
2- name: Install system requirements
3 become: yes
4 apt:
5 name: "{{ item }}"
6 state: present
7 with_items:
8 - python-pip
9
10- name: Update local.conf with enabling plugin
11 lineinfile:
12 path: ~/devstack/local.conf
13 regexp: '^enable_plugin networking-bgpvpn'
14 line: 'enable_plugin networking-bgpvpn git://git.openstack.org/openstack/networking-bgpvpn.git stable/ocata'
15 insertafter: 'enable_plugin'
16
17- name: Update local.conf with driver
18 lineinfile:
19 path: ~/devstack/local.conf
20 regexp: '^NETWORKING_BGPVPN_DRIVER'
21 line: 'NETWORKING_BGPVPN_DRIVER="BGPVPN:OpenContrail:neutron_plugin_contrail.plugins.opencontrail.networking_bgpvpn.contrail.ContrailBGPVPNDriver:default"'
22 insertafter: 'enable_plugin'
23
24- name: Prepare directory for fetching repository
25 become: true
26 file:
27 path: /opt/stack/networking-bgpvpn
28 state: directory
29 owner: "{{ ansible_user_id }}"
30 group: "{{ ansible_user_id }}"
31 mode: 0775
32
33- name: Fetch git repository
34 git:
35 repo: "git://git.openstack.org/openstack/networking-bgpvpn.git"
36 dest: /opt/stack/networking-bgpvpn
37 version: "{{ openstack_branch }}"
38 accept_hostkey: yes
39 force: yes
40
41- name: Move source of neutron to post-config phase
42 lineinfile:
43 state: absent
44 path: /opt/stack/networking-bgpvpn/devstack/plugin.sh
45 regexp: '^source \$NEUTRON_DIR/devstack/lib/l2_agent$'
46
47- name: Move source of neutron to post-config phase
48 lineinfile:
49 state: present
50 path: /opt/stack/networking-bgpvpn/devstack/plugin.sh
51 line: ' source $NEUTRON_DIR/devstack/lib/l2_agent'
52 insertbefore: 'plugin_agent_add_l2_agent_extension'
53
54- name: fix requirements.txt
55 lineinfile:
56 path: /opt/stack/networking-bgpvpn/test-requirements.txt
57 state: absent
58 regexp: 'networking-odl'
59
60- name: copy pip dependencies
61 copy:
62 src: "../files/{{ item }}"
63 dest: /tmp
64 with_items:
65 - 'cfgm_common-0.1.dev0.tar.gz'
66 - 'vnc_api-5.0.0.tar.gz'
67
68- name: install dependencies
69 pip:
70 name: "{{ item }}"
71 become: yes
72 with_items:
73 - '/tmp/cfgm_common-0.1.dev0.tar.gz'
74 - '/tmp/vnc_api-5.0.0.tar.gz'
75 - 'git+git://github.com/Juniper/contrail-neutron-plugin.git#egg=neutron_plugin_contrail'
diff --git a/playbooks/roles/openstack_vm/files/keystone.patch b/playbooks/roles/openstack_vm/files/keystone.patch
deleted file mode 100644
index 9b793f6..0000000
--- a/playbooks/roles/openstack_vm/files/keystone.patch
+++ /dev/null
@@ -1,11 +0,0 @@
1--- keystone.orig 2017-07-30 22:16:21.425892580 +0200
2+++ keystone 2017-07-30 22:14:06.043517113 +0200
3@@ -649,7 +649,7 @@
4 --bootstrap-role-name admin \
5 --bootstrap-service-name keystone \
6 --bootstrap-region-id "$REGION_NAME" \
7- --bootstrap-admin-url "$KEYSTONE_AUTH_URI" \
8+ --bootstrap-admin-url "$KEYSTONE_AUTH_URI/v2.0" \
9 --bootstrap-public-url "$KEYSTONE_SERVICE_URI" \
10 --bootstrap-internal-url "$KEYSTONE_SERVICE_URI"
11 }
diff --git a/playbooks/roles/openstack_vm/files/keystone_stable-pike.patch b/playbooks/roles/openstack_vm/files/keystone_stable-pike.patch
deleted file mode 100644
index 6e883d6..0000000
--- a/playbooks/roles/openstack_vm/files/keystone_stable-pike.patch
+++ /dev/null
@@ -1,10 +0,0 @@
1--- keystone.orig 2018-01-09 10:50:01.005819940 +0000
2+++ keystone 2018-01-09 10:50:18.133820750 +0000
3@@ -607,7 +607,7 @@
4 --bootstrap-role-name admin \
5 --bootstrap-service-name keystone \
6 --bootstrap-region-id "$REGION_NAME" \
7- --bootstrap-admin-url "$KEYSTONE_AUTH_URI" \
8+ --bootstrap-admin-url "$KEYSTONE_AUTH_URI/v2.0" \
9 --bootstrap-public-url "$KEYSTONE_SERVICE_URI"
10 }
diff --git a/playbooks/roles/openstack_vm/meta/main.yml b/playbooks/roles/openstack_vm/meta/main.yml
deleted file mode 100644
index 8e124be..0000000
--- a/playbooks/roles/openstack_vm/meta/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
1---
2dependencies:
3 - { role: common }
4 - { role: fetch_devstack, vm_group: openstack }
5# - { role: contrail_vm }
diff --git a/playbooks/roles/openstack_vm/tasks/main.yml b/playbooks/roles/openstack_vm/tasks/main.yml
deleted file mode 100644
index 590db15..0000000
--- a/playbooks/roles/openstack_vm/tasks/main.yml
+++ /dev/null
@@ -1,8 +0,0 @@
1---
2# setting up Openstack VM
3
4- include: openstack_patch.yml
5
6#- include: install_drv_depend.yml
7
8- include: stack_sh.yml
diff --git a/playbooks/roles/openstack_vm/tasks/openstack_patch.yml b/playbooks/roles/openstack_vm/tasks/openstack_patch.yml
deleted file mode 100644
index e5b51a7..0000000
--- a/playbooks/roles/openstack_vm/tasks/openstack_patch.yml
+++ /dev/null
@@ -1,14 +0,0 @@
1---
2# Patch stack.sh for proper endpoints used by OpenContrail controller
3- name: copy Openstack endpoint patch
4 copy:
5 src: "{{ item }}"
6 dest: ~/devstack/keystone.patch
7 with_first_found:
8 - ../files/keystone_{{ openstack_branch | regex_replace('/', '-') }}.patch
9 - ../files/keystone.patch
10
11- name: patch keystone endpoint
12 shell: patch keystone < ../keystone.patch
13 args:
14 chdir: ~/devstack/lib
diff --git a/playbooks/roles/openstack_vm/tasks/stack_sh.yml b/playbooks/roles/openstack_vm/tasks/stack_sh.yml
deleted file mode 100644
index a087f03..0000000
--- a/playbooks/roles/openstack_vm/tasks/stack_sh.yml
+++ /dev/null
@@ -1,12 +0,0 @@
1---
2# Run stack.sh in case if it is already running, unstack first
3
4- name: optionally unstack
5 shell: screen -ls | grep stack && ./unstack.sh
6 args:
7 chdir: ~/devstack
8 ignore_errors: yes
9
10- name: build OpenStack via stack.sh
11 command: chdir=~/devstack ./stack.sh
12 ignore_errors: no
diff --git a/playbooks/roles/restack_compute_node/tasks/main.yml b/playbooks/roles/restack_compute_node/tasks/main.yml
new file mode 100644
index 0000000..13244e1
--- /dev/null
+++ b/playbooks/roles/restack_compute_node/tasks/main.yml
@@ -0,0 +1,15 @@
1---
2- name: optionally unstack
3 shell: PATH="/usr/sbin:$PATH" ./unstack.sh
4 args:
5 chdir: ~/devstack
6 ignore_errors: yes
7
8- name: build OpenStack via stack.sh
9 command: ./stack.sh
10 args:
11 chdir: ~/devstack
12
13- name: discover hosts on openstack
14 delegate_to: "{{ hostvars['controller'].ansible_host }}"
15 shell: nova-manage cell_v2 discover_hosts
diff --git a/playbooks/roles/restack_contrail/tasks/main.yml b/playbooks/roles/restack_contrail/tasks/main.yml
deleted file mode 100644
index 80cc0b7..0000000
--- a/playbooks/roles/restack_contrail/tasks/main.yml
+++ /dev/null
@@ -1,5 +0,0 @@
1---
2# setting up again OpenContrail VM
3- include: unstack_sh.yml
4- include: services.yml
5- include: stack_sh.yml
diff --git a/playbooks/roles/restack_contrail/tasks/services.yml b/playbooks/roles/restack_contrail/tasks/services.yml
deleted file mode 100644
index 5fa53e0..0000000
--- a/playbooks/roles/restack_contrail/tasks/services.yml
+++ /dev/null
@@ -1,10 +0,0 @@
1---
2# setup local.conf for restacking
3- name: uncomment n-cpu & placement-api (if needed)
4 lineinfile:
5 dest: ~/devstack/local.conf
6 regexp: (?i)^\s*#\s*({{ item }}.*)
7 line: \1
8 backrefs: yes
9 with_items:
10 - 'ENABLED_SERVICES'
diff --git a/playbooks/roles/restack_contrail/tasks/stack_sh.yml b/playbooks/roles/restack_contrail/tasks/stack_sh.yml
deleted file mode 100644
index 3613f45..0000000
--- a/playbooks/roles/restack_contrail/tasks/stack_sh.yml
+++ /dev/null
@@ -1,14 +0,0 @@
1---
2# Run stack.sh in case if it is already running, unstack first
3
4- name: optionally unstack
5 shell: screen -ls | grep stack && ./unstack.sh
6 args:
7 chdir: ~/devstack
8 ignore_errors: yes
9
10- name: stack.sh again Contrail
11 shell: ./stack.sh
12 args:
13 chdir: ~/devstack
14 ignore_errors: no
diff --git a/playbooks/roles/restack_contrail/tasks/unstack_sh.yml b/playbooks/roles/restack_contrail/tasks/unstack_sh.yml
deleted file mode 100644
index fcd5ac4..0000000
--- a/playbooks/roles/restack_contrail/tasks/unstack_sh.yml
+++ /dev/null
@@ -1,5 +0,0 @@
1---
2# run unstack.sh
3- name: unstack.sh Contrail node
4 command: chdir=~/devstack ./unstack.sh
5 ignore_errors: no
diff --git a/playbooks/roles/restack_controller_node/tasks/main.yml b/playbooks/roles/restack_controller_node/tasks/main.yml
new file mode 100644
index 0000000..9393f06
--- /dev/null
+++ b/playbooks/roles/restack_controller_node/tasks/main.yml
@@ -0,0 +1,11 @@
1---
2- name: optionally unstack
3 shell: ./unstack.sh
4 args:
5 chdir: ~/devstack
6 ignore_errors: yes
7
8- name: build OpenStack via stack.sh
9 command: ./stack.sh
10 args:
11 chdir: ~/devstack
diff --git a/playbooks/roles/source_openrc/tasks/main.yml b/playbooks/roles/source_openrc/tasks/main.yml
deleted file mode 100644
index c7293fb..0000000
--- a/playbooks/roles/source_openrc/tasks/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
1---
2# source openrc
3- include: source_openrc.yml
diff --git a/playbooks/roles/source_openrc/tasks/source_openrc.yml b/playbooks/roles/source_openrc/tasks/source_openrc.yml
deleted file mode 100644
index 324e5fd..0000000
--- a/playbooks/roles/source_openrc/tasks/source_openrc.yml
+++ /dev/null
@@ -1,11 +0,0 @@
1---
2# source openrc in bash profile
3- name: source openrc in profile
4 lineinfile:
5 dest: ~/.profile
6 regexp: ".*openrc"
7 line: ". ~/devstack/openrc"
8 state: present
9
10- name: source openrc in current shell
11 shell: . ~/devstack/openrc