[Build 3059] K8S Provisioning failure with Ansible

Bug #1685661 reported by chhandak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
High
Nitish Krishna Kaveri

Bug Description

Hitting bellow error while provisioning K8S setup with 3059. I am using the contrail-ansible package available with the build. It is expecting 'keystone_config' which is not applicable for K8S cluster.

Logs
------
TASK [node : Register analytics node with controller] **************************
fatal: [10.87.121.34]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: {{ keystone_opts if cloud_orchestrator == 'openstack' else '' }}: --admin_user {{ keystone_admin_user }} --admin_password {{ keystone_admin_password }} --admin_tenant_name {{ keystone_admin_tenant }}: {{ keystone_config.get('admin_tenant','admin') }}: 'keystone_config' is undefined\n\nThe error appears to have been in '/root/Kubernetes/3059/contrail-ansible/playbooks/roles/node/tasks/register_with_controller.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: \"Register analytics node with controller\"\n ^ here\n"}
                to retry, use: --limit @/root/Kubernetes/3059/contrail-ansible/playbooks/site.retry

PLAY RECAP *********************************************************************
10.87.121.34 : ok=64 changed=19 unreachable=0 failed=1
10.87.121.35 : ok=55 changed=11 unreachable=0 failed=0
10.87.121.36 : ok=55 changed=11 unreachable=0 failed=0

Host File
-----------
root@5b6s33:~/Kubernetes/3059/contrail-ansible/playbooks# cat inventory/my-inventory/hosts
# Enable contrail-repo when required - this will start a contrail apt or yum repo container on specified node
# This repo will be used by other nodes on installing any packages in the node
# setting up contrail-cni need this repo enabled
# NOTE: Repo is required only for mesos and nested mode kubernetes
[contrail-repo]
10.87.121.34

[contrail-controllers]
10.87.121.34

[contrail-analyticsdb]
10.87.121.34

[contrail-analytics]
10.87.121.34

[contrail-kubernetes]
10.87.121.34

[contrail-compute]
10.87.121.35
10.87.121.36

##
# Only enable if you setup with openstack (when cloud_orchestrator is openstack)
##
;[openstack-controllers]
;192.168.0.23
root@5b6s33:~/Kubernetes/3059/contrail-ansible/playbooks#

root@5b6s33:~/Kubernetes/3059/contrail-ansible#
root@5b6s33:~/Kubernetes/3059/contrail-ansible# cat playbooks/inventory/my-inventory/group_vars/all.yml
###################################################
# Docker configurations
##
# docker registry
docker_registry: 10.84.34.155:5000
docker_registry_insecure: True

# install docker from package rather than installer from get.docker.com which is default method
docker_install_method: package

###################################################
# Ansible specific vars
##

# ansible connection details
ansible_user: root
ansible_become: true
# ansible_ssh_private_key_file: ~/.ssh/id_rsa

###################################################
# Common settings for contrail
##

# contrail_compute_mode - the values are bare_metal to have bare_metal agent setup and "container" for agent container
# default is bare_metal
contrail_compute_mode: container

# os_release - operating system release - ubuntu 14.04 - ubuntu14.04, ubuntu 16.04 - ubuntu16.04, centos 7.1 - centos7.1, centos 7.2 - centos7.2
os_release: ubuntu14.04

# contrail version
contrail_version: 4.0.0.0-3059

# cloud_orchestrator - cloud orchestrators to be setup
# Valid cloud orchestrators:
# kubernetes, mesos, openstack, openshift
cloud_orchestrator: kubernetes

# vrouter physical interface
vrouter_physical_interface: eno1

# custom image for kube-manager - image with ubuntu 16.04 and systemd
# contrail_kube_manager_image: 10.84.34.155:5000/contrail-kube-manager-u16.04:4.0.0.0-3016

# custom image for mesos-manager - image with ubuntu 16.04 and systemd
# contrail_mesos_manager_image: 10.84.34.155:5000/contrail-mesos-manager-u16.04:4.0.0.0-3016

# controller_ip can be load ballanced IP, or one of the controller_list
# if not configured, ansible use first ip address from [contrail-controllers]
# controller_ip: 192.168.0.22

##################
# Below config params (i.e the variables named .*_config) are used to configure contrailctl
# All of below variables are a dict which form individual section of contrailctl/*.conf (controller.conf, agent.conf, etc)
# they are just a dictionary form of config files found under contrailctl/*
# Please refer examples/fully_commented_inventory for full list of variables available
###################

# global_config: controller_list, analytics_list, analyticsdb_list etc would be automatically detected by ansible code based out of hosts file host group sections
# e.g controller_list is all ips added under [contrail-controllers]
# This vars will be configured in [GLOBAL] section of all contrailctl config files (contrailctl/*.conf)

# global_config:

# To configure custom webui http port
webui_config: {http_listen_port: 8085}
docker_py_pkg_install_method: pip
###################################################
# Openshift specific configuration
##
# openshift_config: {token: <openshift token>}

###################################################
# Openstack specific configuration
##
# contrail_install_packages_url: "http://10.84.5.120/github-build/mainline/3023/ubuntu-14-04/mitaka/contrail-install-packages_4.0.0.0-3023~mitaka_all.deb"
# keystone_config: {ip: 192.168.0.23, admin_password: contrail123}

chhandak (chhandak)
Changed in juniperopenstack:
importance: Undecided → High
assignee: nobody → Abhay Joshi (abhayj)
milestone: none → r4.0
information type: Proprietary → Public
chhandak (chhandak)
description: updated
Revision history for this message
Nitish Krishna Kaveri (nitishk) wrote :

keystone_config is expected. Need to add default of {} in register role

Changed in juniperopenstack:
assignee: Abhay Joshi (abhayj) → Nitish Krishna Kaveri (nitishk)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/30706
Submitter: Nitish Krishna Kaveri (<email address hidden>)

Jeba Paulaiyan (jebap)
tags: added: blocker
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/30706
Committed: http://github.com/Juniper/contrail-ansible/commit/19af6b3475cd425c48eba8251cd421434a55ab88
Submitter: Zuul (<email address hidden>)
Branch: master

commit 19af6b3475cd425c48eba8251cd421434a55ab88
Author: nitishkrishna <email address hidden>
Date: Mon Apr 24 10:30:50 2017 -0700

Closes-Bug: #1685661 - Register role expects keystone config which is not there in K8s

This will bring default empty dict for keystone_config

Patch 2: Register role restricted to openstack orchestrator

Change-Id: I5864cad98b427692988c16aa0e8f1e3f79ceee92

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.