Provision fails for Contrail 5.0 (contrail-ansible-deployer) for orch: K8s
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R5.0 |
Fix Committed
|
Critical
|
Madhava Jayamani | |||
Trunk |
Fix Committed
|
Critical
|
Bartosz Kupidura |
Bug Description
Provision fails for Contrail 5.0 (contrail-
Setup : 10.87.118.145
2018-03-30 18:40:01,907 p=10403 u=root | TASK [install_contrail : show master list] *******
2018-03-30 18:40:01,986 p=10403 u=root | ok: [10.0.0.7] => {}
2018-03-30 18:40:01,987 p=10403 u=root | ok: [10.0.0.8] => {}
2018-03-30 18:40:02,005 p=10403 u=root | ok: [10.0.0.9] => {}
2018-03-30 18:40:02,029 p=10403 u=root | ok: [10.0.0.6] => {}
2018-03-30 18:40:02,045 p=10403 u=root | TASK [install_contrail : set master] *******
2018-03-30 18:40:02,100 p=10403 u=root | fatal: [10.0.0.7]: FAILED! => {}
MSG:
The task includes an option with an undefined variable. The error was: list object has no element 0
The error appears to have been in '/tmp/ansible.
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: set master
^ here
exception type: <class 'ansible.
exception: list object has no element 0
2018-03-30 18:40:02,102 p=10403 u=root | fatal: [10.0.0.8]: FAILED! => {}
MSG:
The task includes an option with an undefined variable. The error was: list object has no element 0
Instances.yaml used for deploying:
[root@server3 config]# cat instances.yaml
REGISTRY_
CONTAINER_REGISTRY: ci-repo.
provider_config:
bms:
domainsuffix: local
ntpserver: 10.84.5.100
ssh_pwd: c0ntrail123
ssh_user: root
instances:
server1:
ip: 10.0.0.4
provider: bms
roles:
config: null
control: null
webui: null
server2:
ip: 10.0.0.5
provider: bms
roles:
config: null
control: null
webui: null
server3:
ip: 10.0.0.6
provider: bms
roles:
config: null
control: null
webui: null
server4:
ip: 10.0.0.7
provider: bms
roles:
k8s_node: null
vrouter: null
server5:
ip: 10.0.0.8
provider: bms
roles:
k8s_node: null
vrouter: null
server6:
ip: 10.0.0.9
provider: bms
roles:
k8s_node: null
vrouter: null
contrail_
CONTAINER_
CONTRAIL_VERSION: latest
CLOUD_
METADATA_
CONTROLLER_NODES: 10.10.0.
AAA_MODE: no-auth
CONTROLLER_NODES: 10.10.0.
CONTROL_
PHYSICAL_
VROUTER_GATEWAY: 10.10.0.1
two_interface: true
[root@server3 config]#
Logs can be found and the below location:
madhavaj@
total 3588K
-rwxrwxrwx 1 madhavaj jrs 1695 Mar 30 13:53 instances.yaml
-rwxrwxrwx 1 madhavaj jrs 3653514 Mar 30 13:53 ansible.log
madhavaj@
description: | updated |
description: | updated |
information type: | Proprietary → Public |
Reassigning to Bartosz based on this email thread:
%<----- ------- ------- ------- ------- ------- ------- --
+Bartosz
Hi Ram,
the referenced yaml is executed by this loop:
- name: set master name].k8s_ master is defined or roles[instance_ name].k8s_ node is defined
include: set_master.yml
with_items:
- "{{ controller_list }}"
loop_control:
loop_var: controller_item
when: roles[instance_
tags:
- k8s
from main.yaml.
The problem is that we are working with a single controller_list which is wrong.
Bartosz is working on creating a controller_list per role.
@Bartosz, we also need to consider k8s. Can you cross check all references where controller_list is used?
We need to replace it with the role specific controller_list.
Regards,
Michael
Am 01.04.2018 um 00:47 schrieb Ramprakash Ram Mohan <email address hidden>:
Hi Michael,
https:/ /bugs.launchpad .net/juniperope nstack/ +bug/1760217
This bug was hit in a sanity setup where the k8s master and contrail controller roles were separate.
I could not understand the logic in this code here (in set_master.yml)
- name: fill master list item][' private_ ip'] ] }}" item][' instance_ name']] .k8s_master is defined and controller_item in hostvars[ item].ansible_ all_ipv4_ addresses 'container_ hosts'] }}"
set_fact:
master_list: "{{ master_list + [ hostvars[
when: roles[hostvars[
with_items:
- "{{ groups[
In this scenario it looks like it is normal that master_list is not updated at all. What is the reason for adding the “and controller_item in hostvars[ item].ansible_ all_ipv4_ addresses” conditional? item][‘ instance_ name’]] .k8s_master?
Is it not sufficient to just check roles[hostvars[
Please let me know.
Thanks,
Ram