Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1653092 - redeploy-node-certificates.yml fails due to syntax error in openshift-node/restart.yml
Summary: redeploy-node-certificates.yml fails due to syntax error in openshift-node/re...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.7.1
Hardware: x86_64
OS: Linux
Target Milestone: ---
: 3.7.z
Assignee: Scott Dodson
QA Contact: Gaoyun Pei
Depends On:
TreeView+ depends on / blocked
Reported: 2018-11-25 16:39 UTC by Andre Costa
Modified: 2019-05-03 13:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The last release of openshift-ansible 3.7 introduced an ansible syntax error in playbooks/common/openshift-node/restart.yml. This error has been corrected.
Clone Of:
Last Closed: 2019-05-03 13:07:47 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Andre Costa 2018-11-25 16:39:19 UTC
Description of problem:
When running the redeploy-node-certificates playbook it fails on restarting the node with a little misleading error. Playbook fails pointing the issue being a syntax error on common/openshift-node/restart.yml in the line 'retries: 24'
The problem is the identation of the lines between 'until:' and the comment '# Give the node two minutes to come back online.'

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

rpm -q ansible
ansibe.noarch 0:

ansible --version
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, May 31 2018, 09:41:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

How reproducible:
Everytime a playbook is run that depends on /usr/share/ansible/openshift-ansible/playbooks/common/openshift-node/restart.yml

Steps to Reproduce:
1.ansible-playbook -vvv -i </path/to/inventory> /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/redeploy-node-certificates.yml
2. Edit file /usr/share/ansible/openshift-ansible/playbooks/common/openshift-node/restart.yml to correct lines 67-74
3. Re-run the playbook which ends successfully.

Actual results:

Expected results:
Run playbooks without happening or with better failure reason in case something like this occurs.

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

Comment 1 Scott Dodson 2018-11-26 16:40:11 UTC
OCP 3.7 is known not to work with Ansible 2.4, can you please confirm whether or not this problem happens when using Ansible 2.3?

Comment 2 Scott Dodson 2018-11-26 16:43:22 UTC
Nevermind, you're correct, improper indentation.


Comment 3 Scott Dodson 2018-11-26 16:46:20 UTC
Problem was introduced here https://github.com/openshift/openshift-ansible/pull/10528

Comment 4 Scott Dodson 2019-02-28 20:04:38 UTC
In openshift-ansible-3.7.75-1

Comment 5 Gaoyun Pei 2019-03-01 06:24:30 UTC
Could reproduce with openshift-ansible-3.7.72-1

[root@gpei-preserve-ansible-slave ~]# ansible-playbook -i host/37 openshift-ansible/playbooks/byo/openshift-cluster/redeploy-node-certificates.yml -v

The error appears to have been in '/root/openshift-ansible/playbooks/common/openshift-node/restart.yml': line 76, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    # Give the node two minutes to come back online.
    retries: 24
    ^ here

exception type: <class 'yaml.parser.ParserError'>
exception: while parsing a block mapping
  in "<unicode string>", line 2, column 3
did not find expected key
  in "<unicode string>", line 76, column 5

Verify with openshift-ansible-3.7.75-1, redeploy-node-certificates.yml playbook could finish successfully.

Comment 6 Scott Dodson 2019-05-03 13:07:47 UTC
openshift-ansible-3.7.108-1.git.0.8092d27.el7 included this fix

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