Bug 1546293 - openshift-ansible playbook failed to deploy cluster due to templating error
Summary: openshift-ansible playbook failed to deploy cluster due to templating error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.9.0
Assignee: Russell Teague
QA Contact: Peter Ruan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-16 19:48 UTC by Peter Ruan
Modified: 2018-03-28 14:29 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Corrected the case of Jinja2 'none' object.
Clone Of:
Environment:
Last Closed: 2018-03-28 14:29:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 0 None None None 2018-03-28 14:29:53 UTC

Description Peter Ruan 2018-02-16 19:48:17 UTC
Description of problem:
  openshift-ansible playbook failed to deploy cluster due to templating error


Version-Release number of selected component (if applicable):
latest

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:


Description of problem:

Version-Release number of the following components:
rpm -q openshift-ansible
rpm -q ansible
ansible --version

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:

TASK [openshift_persistent_volumes : include_tasks] ****************************
Friday 16 February 2018  19:09:03 +0000 (0:00:00.324)       0:05:18.395 ******* 
included: /home/slave3/workspace/Launch Environment Flexy/private-openshift-ansible/roles/openshift_persistent_volumes/tasks/pvc.yml for host-8-246-82.host.centralci.eng.rdu2.redhat.com

TASK [openshift_persistent_volumes : Deploy PersistentVolumeClaim definitions] ***
Friday 16 February 2018  19:09:03 +0000 (0:00:00.035)       0:05:18.431 ******* 
fatal: [host-8-246-82.host.centralci.eng.rdu2.redhat.com]: FAILED! => {"changed": false, "msg": "AnsibleError: template error while templating string: no test named 'None'. String: ---\napiVersion: \"v1\"\nkind: \"List\"\nitems:\n{% for claim in persistent_volume_claims %}\n- apiVersion: \"v1\"\n  kind: \"PersistentVolumeClaim\"\n  metadata:\n    name: \"{{ claim.name }}\"\n  spec:\n    accessModes: {{ claim.access_modes | lib_utils_to_padded_yaml(2, 2) }}\n    resources:\n      requests:\n        storage: \"{{ claim.capacity }}\"\n{% if claim.storageclass is not None %}\n    storageClassName: \"{{ claim.storageclass }}\"\n{% endif %}\n{% endfor %}\n"}
	to retry, use: --limit @/home/slave3/workspace/Launch Environment Flexy/private-openshift-ansible/playbooks/deploy_cluster.retry

PLAY RECAP *********************************************************************
host-8-246-82.host.centralci.eng.rdu2.redhat.com : ok=479  changed=180  unreachable=0    failed=1   
localhost                  : ok=13   changed=0    unreachable=0    failed=0   


INSTALLER STATUS ***************************************************************
Initialization             : Complete (0:00:14)
Health Check               : Complete (0:00:19)
etcd Install               : Complete (0:00:37)
NFS Install                : Complete (0:00:13)
Master Install             : Complete (0:02:00)
Master Additional Install  : Complete (0:00:21)
Node Install               : Complete (0:01:31)
Hosted Install             : In Progress (0:00:02)
	This phase can be restarted by running: playbooks/openshift-hosted/config.yml
 


Play:     Create Hosted Resources - persistent volumes
     Task:     Deploy PersistentVolumeClaim definitions
     Message:  AnsibleError: template error while templating string: no test named 'None'. String: ---
               apiVersion: "v1"
               kind: "List"
               items:
               {% for claim in persistent_volume_claims %}
               - apiVersion: "v1"
                 kind: "PersistentVolumeClaim"
                 metadata:
                   name: "{{ claim.name }}"
                 spec:
                   accessModes: {{ claim.access_modes | lib_utils_to_padded_yaml(2, 2) }}
                   resources:
                     requests:
                       storage: "{{ claim.capacity }}"
               {% if claim.storageclass is not None %}
                   storageClassName: "{{ claim.storageclass }}"
               {% endif %}
               {% endfor %}

Expected results:

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Russell Teague 2018-02-16 21:22:32 UTC
Related to recent changes in https://github.com/openshift/openshift-ansible/pull/7106

Comment 2 Russell Teague 2018-02-16 21:54:24 UTC
Fixed in: https://github.com/openshift/openshift-ansible/pull/7182

Comment 3 Russell Teague 2018-02-20 13:21:23 UTC
Merged.  Waiting for build with commit 5c393c4cc5b50b6223563f7f851fe4671b012575

Comment 4 Nicholas Schuetz 2018-02-20 16:38:39 UTC
confirmed that 7182 does indeed fix this issue.


Initialization             : Complete (0:00:31)
Health Check               : Complete (0:00:04)
etcd Install               : Complete (0:00:41)
Load balancer Install      : Complete (0:00:10)
Master Install             : Complete (0:02:48)
Master Additional Install  : Complete (0:00:38)
Node Install               : Complete (0:03:52)
Hosted Install             : Complete (0:01:35)
Web Console Install        : Complete (0:00:34)
Metrics Install            : Complete (0:01:16)
Logging Install            : Complete (0:02:48)
Prometheus Install         : Complete (0:00:25)
Service Catalog Install    : Complete (0:01:29)

[root@master01 ~]# rpm -q atomic-openshift-master 
atomic-openshift-master-3.9.0-0.46.0.git.0.d03ead3.el7.x86_64

Comment 6 Peter Ruan 2018-02-26 07:36:53 UTC
I can now able to spin up instances with .51

Comment 9 errata-xmlrpc 2018-03-28 14:29:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0489


Note You need to log in before you can comment on or make changes to this bug.