setup-hosts.yml does not work correctly when combined with --limit
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack-Ansible |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Issue description
=================
In major upgrade guide [1], it is suggested to run setup-hosts.yml in a following manner:
openstack-ansible setup-hosts.yml --limit '!galera_
openstack-ansible setup-hosts.yml -e 'lxc_container_
The crucial thing is that setup-hosts.yml imports playbooks like certificate-
Unfortunately, when --limit is used, playbook is not executed against localhost which may lead to several unexpected issues.
Steps to reproduce
==================
# openstack-ansible certificate-
## OUTPUT
playbook: certificate-
play #1 (localhost): Create CA certificates TAGS: [always]
pattern: ['localhost']
hosts (0):
## EXPECTED OUTPUT
playbook: certificate-
play #1 (localhost): Create CA certificates TAGS: [always]
pattern: ['localhost']
hosts (1):
localhost
Explanation
===========
It happens because implicit localhost[2] is not a part of 'all' nor any other group.[3]
Possible solutions
==================
1. Add localhost explicitly to the inventory. It will then match the 'all' group in our playbooks too with all undesired possible effects, but i think it's not a problem with OSA because we don't run any playbooks against 'all' group.
2. Add 'all' and 'localhost' to --limit(--limit 'localhost:
Links
=====
[1] https:/
[2] https:/
[3] https:/
summary: |
- setup-hosts.yml does not run correctly when combined with --limit + setup-hosts.yml does not work correctly when combined with --limit |
Fix proposed to branch: master /review. opendev. org/c/openstack /openstack- ansible/ +/899523
Review: https:/