ceph-ansible inventory generation incorrectly sets whitespace for ansible_connection: local

Bug #1800148 reported by John Fulton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Low
John Fulton

Bug Description

Changes to fix #1798044 [1] broke the recently added support for "ansible_connection: local" [2] in the ceph-ansible inventory generated by TripleO. Workaround: Adding the whitespace manually [3].

[1] https://github.com/openstack/tripleo-heat-templates/commit/5bcfb7114666efc0172132a4ebe0f5cff2be7931

[2] https://github.com/openstack/tripleo-heat-templates/commit/3f5ed998eb91b93cdb595949c394c301017940d5#diff-f84644f1b5951f535bc7c3f4151a9a90

[3]
[root@overcloud0 ceph-ansible]# cat inventory.yml

mgrs:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
ansible_connection: local
mons:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
ansible_connection: local
osds:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
ansible_connection: local
clients:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
ansible_connection: local
[root@overcloud0 ceph-ansible]# ansible -i inventory.yml -m ping all
 [WARNING]: While constructing a mapping from /root/undercloud-ansible-xYltb8/ceph-ansible/inventory.yml, line 2, column 1, found a duplicate dict key (ansible_connection). Using last defined value only.

overcloud0 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).\r\n",
    "unreachable": true
}
[root@overcloud0 ceph-ansible]# vim inventory.yml
[root@overcloud0 ceph-ansible]#
[root@overcloud0 ceph-ansible]# cat inventory.yml

mgrs:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
      ansible_connection: local
mons:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
      ansible_connection: local
osds:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
      ansible_connection: local
clients:
  hosts:
    overcloud0:
      ansible_user: root
      ansible_host: 192.168.24.2
      ansible_become: true
      ansible_connection: local
[root@overcloud0 ceph-ansible]#
[root@overcloud0 ceph-ansible]# ansible -i inventory.yml -m ping all
overcloud0 | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
[root@overcloud0 ceph-ansible]#

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/613793

Changed in tripleo:
assignee: nobody → John Fulton (jfulton-org)
status: Triaged → In Progress
tags: added: rocky-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/613793
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=b201df7257f700edab56e13d2d85e503624e634a
Submitter: Zuul
Branch: master

commit b201df7257f700edab56e13d2d85e503624e634a
Author: John Fulton <email address hidden>
Date: Sun Oct 28 11:06:20 2018 -0400

    Add additional whitespace around "ansible_connection: local"

    The jinja2 condition to look for "ansible_connection: local"
    did not contain enough whitespace and resulted in an invalid
    Ansible inventory. This patch adds the missing whitespace by
    indenting the condition.

    Change-Id: Ia114edafe6f1b37d6e6d47af146ab35adeb79efd
    Closes-Bug: #1800148

Changed in tripleo:
status: In Progress → Fix Released
tags: removed: rocky-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/615248

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/615248
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=2af5dd6fca62e772257414539e44940442c64816
Submitter: Zuul
Branch: master

commit 2af5dd6fca62e772257414539e44940442c64816
Author: Alan Bishop <email address hidden>
Date: Fri Nov 2 13:06:00 2018 -0400

    Fix whitespace around "ansible_connection: local"

    Small follow-up fix to the original patch [1].

    [1] https://review.openstack.org/613793

    Related-Bug: #1800148
    Change-Id: I8db6dc3b3beaeb1b6582a7ab086d3942eb03dfc4

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 10.2.0

This issue was fixed in the openstack/tripleo-heat-templates 10.2.0 release.

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.