Bug 1644920

Summary: config-download playbooks using wrong (short) hostnames
Product: Red Hat OpenStack Reporter: Lars Kellogg-Stedman <lars>
Component: python-tripleoclientAssignee: James Slagle <jslagle>
Status: CLOSED NOTABUG QA Contact: Gurenko Alex <agurenko>
Severity: medium Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: emacchi, hbrock, jslagle, lars, lshort, mburns, sbaker
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-05 20:41:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1644917, 1738344    
Bug Blocks:    

Description Lars Kellogg-Stedman 2018-10-31 22:15:09 UTC
Description of problem:

After generating an inventory by running `tripleo-ansible-inventory --static-yaml-inventory hosts.yml` and subsequently running `ansible-playbook deployments-steps.yaml`, the deploy fails at the `tripleo-ssh-known-hosts` task with the following error:

    TASK [tripleo-ssh-known-hosts : Add hosts key in /etc/ssh/ssh_known_hosts for live/cold-migration] ***
    fatal: [neu-17-11-nc2.kzn.moc]: FAILED! => {"failed": true, "msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute u'neu-17-11-nc2'\n\nThe error appears to have been in '/usr/share/ansible/roles/tripleo-ssh-known-hosts/tasks/main.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: Add hosts key in /etc/ssh/ssh_known_hosts for live/cold-migration\n  ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no attribute u'neu-17-11-nc2'"}

As you can see here, ansible is connecting to a host using a fully qualified name (`neu-17-11-nc2.kzn.moc`) but is then attempting to reference the host using an unqualified hostname (`neu-17-11-nc2`).

Comment 1 James Slagle 2018-10-31 23:46:40 UTC
Please provide all templates (if anything is modified), and all environments, and the full deployment command, and what package versions are in use. Undercloud logs would also be helpful.

I don't even know what `ansible-playbook deployments-steps.yaml` would do since that playbook doesn't exist as part of config-download.

Comment 2 Lars Kellogg-Stedman 2018-11-01 13:02:24 UTC
Sorry, it's spelled `deploy_steps_playbook.yaml`.

Templates and environment files are all available at:

  https://github.com/CCI-MOC/rhosp-director-config/tree/new-kaizen

The initial deploy command is:

  https://github.com/CCI-MOC/rhosp-director-config/blob/new-kaizen/overcloud-deploy.sh

I'll attach the result of running `config download` against this environment if I can get the download to complete.

Comment 3 James Slagle 2018-11-01 13:40:22 UTC
this would likely be fixed by fixing https://bugzilla.redhat.com/show_bug.cgi?id=1644916

Comment 4 James Slagle 2018-11-01 13:41:41 UTC
try the suggestion in https://bugzilla.redhat.com/show_bug.cgi?id=1644916 and let us know

Comment 5 Lars Kellogg-Stedman 2018-11-01 18:34:00 UTC
This is blocked by #1644917 since it takes so long to download the configuration.

Comment 6 Lars Kellogg-Stedman 2018-11-06 14:46:10 UTC
This has been resolved by the changes to HostNameMap, which is now using unqualified hostnames.

Comment 7 Luke Short 2019-06-05 20:41:12 UTC
As previously stated, config-download/Ansible requires the short hostnames of the Overcloud nodes to be used in the Heat variable `HostNameMap`.

https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html/director_installation_and_usage/configuring-the-overcloud-with-ansible#enabling-config-download-with-pre-provisioned-nodes