playbook to refresh compute nodes, timeouts lengthened, docs
added profile_name file to cord_profile dir
fix syntax error
Change-Id: I94392a7f3018aabee4c4fb0eb781fd152aa3745b
diff --git a/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2 b/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2
index b43e1e3..0e89cdc 100644
--- a/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2
+++ b/roles/compute-node-config/templates/openstack-compute-vtn.yaml.j2
@@ -28,7 +28,13 @@
# VTN networking for OpenStack Compute Nodes
{% for node in groups["compute"] %}
-{% if 'ipv4' in hostvars[node]['ansible_fabric'] %}
+{% if (('ipv4' in hostvars[node]['ansible_fabric']) or
+ ('ipv4' in hostvars[node]['ansible_br_int'])) %}
+{% if ('ipv4' in hostvars[node]['ansible_fabric']) %}
+{% set node_interface = hostvars[node]['ansible_fabric'] %}
+{% else %}
+{% set node_interface = hostvars[node]['ansible_br_int'] %}
+{% endif %}
# Compute node, fully defined in compute-nodes.yaml
{{ hostvars[node]['ansible_hostname'] }}:
@@ -43,7 +49,7 @@
type: tosca.nodes.Tag
properties:
name: bridgeId
- value: of:0000{{ hostvars[node]['ansible_fabric']['macaddress'] | hwaddr('bare') }}
+ value: of:0000{{ node_interface['macaddress'] | hwaddr('bare') }}
requirements:
- target:
node: {{ hostvars[node]['ansible_hostname'] }}
@@ -71,7 +77,7 @@
type: tosca.nodes.Tag
properties:
name: dataPlaneIp
- value: {{ ( hostvars[node]['ansible_fabric']['ipv4']['address'] ~ '/' ~ hostvars[node]['ansible_fabric']['ipv4']['netmask'] ) | ipaddr('cidr') }}
+ value: {{ ( node_interface['ipv4']['address'] ~ '/' ~ node_interface['ipv4']['netmask'] ) | ipaddr('cidr') }}
requirements:
- target:
node: {{ hostvars[node]['ansible_hostname'] }}
diff --git a/roles/compute-node-config/templates/openstack-compute.yaml.j2 b/roles/compute-node-config/templates/openstack-compute.yaml.j2
index b0849dc..7325aa4 100644
--- a/roles/compute-node-config/templates/openstack-compute.yaml.j2
+++ b/roles/compute-node-config/templates/openstack-compute.yaml.j2
@@ -25,7 +25,8 @@
# OpenStack compute nodes
{% for node in groups["compute"] %}
-{% if 'ipv4' in hostvars[node]['ansible_fabric'] %}
+{% if (('ipv4' in hostvars[node]['ansible_fabric']) or
+ ('ipv4' in hostvars[node]['ansible_br_int'])) %}
{{ hostvars[node]['ansible_hostname'] }}:
type: tosca.nodes.Node
requirements:
diff --git a/roles/compute-node-enable/tasks/main.yml b/roles/compute-node-enable/tasks/main.yml
index 5f3557c..f746241 100644
--- a/roles/compute-node-enable/tasks/main.yml
+++ b/roles/compute-node-enable/tasks/main.yml
@@ -2,7 +2,10 @@
# compute-node-enable/tasks/main.yml
- name: Load TOSCA to add OpenStack compute nodes
- command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} {{ cord_profile_dir }}/openstack-compute.yaml"
+ command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} {{ cord_profile_dir }}/{{ item }}"
+ with_items:
+ - openstack.yaml
+ - openstack-compute.yaml
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
@@ -11,7 +14,10 @@
seconds: 20
- name: Load TOSCA to enable VTN on OpenStack compute nodes
- command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} {{ cord_profile_dir }}/openstack-compute-vtn.yaml"
+ command: "python /opt/xos/tosca/run.py {{ xos_admin_user }} {{ cord_profile_dir }}/{{ item }}"
+ with_items:
+ - vtn-service.yaml
+ - openstack-compute-vtn.yaml
tags:
- skip_ansible_lint # TOSCA loading should be idempotent
diff --git a/roles/cord-profile/tasks/main.yml b/roles/cord-profile/tasks/main.yml
index 628947b..aa17d52 100644
--- a/roles/cord-profile/tasks/main.yml
+++ b/roles/cord-profile/tasks/main.yml
@@ -11,6 +11,12 @@
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_gid }}"
+- name: Create cord_profile/profile_name with the name of the profile
+ copy:
+ dest: "{{ cord_profile_dir }}/profile_name"
+ content: "{{ cord_profile }}"
+ mode: 0644
+
- name: Create subdirectories inside cord_profile directory
file:
path: "{{ cord_profile_dir }}/{{ item }}"
diff --git a/roles/xos-onboarding/tasks/main.yml b/roles/xos-onboarding/tasks/main.yml
index 841125b..9f02a01 100644
--- a/roles/xos-onboarding/tasks/main.yml
+++ b/roles/xos-onboarding/tasks/main.yml
@@ -66,7 +66,7 @@
register: xos_onboard_status
until: '"true" in xos_onboard_status.content'
retries: 60
- delay: 5
+ delay: 10
with_items: "{{ xos_libraries }}"
- name: Wait for services to be onboarded
@@ -77,7 +77,7 @@
register: xos_onboard_status
until: '"true" in xos_onboard_status.content'
retries: 60
- delay: 5
+ delay: 10
with_items: "{{ xos_services }}"
- name: Wait for XOS to be onboarded after service onboarding
@@ -88,5 +88,5 @@
register: xos_onboard_status
until: '"true" in xos_onboard_status.content'
retries: 60
- delay: 5
+ delay: 10