Syntax error in octavia-undercloud role

Bug #1770153 reported by Carlos Goncalves
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Carlos Goncalves

Bug Description

(undercloud) [stack@undercloud-0 ~]$ mistral execution-get-output 94fd8f48-4179-4667-bb62-bb240ace6c83
{
    "result": "Failure caused by error in tasks: octavia_post_workflow\n\n octavia_post_workflow [task_ex_id=d519bfb1-90c8-4c55-bcc3-908ba15229c0] -> Failure caused by error in tasks: upload_amphora\n\n upload_amphora [task_ex_id=40b5518e-0581-4192-85a6-e8f527c0ea13] -> Failed to run action [action_ex_id=0bef89de-fc70-48a2-a39b-28363ece265c, action_cls='<class 'mistral.actions.action_factory.AnsiblePlaybookAction'>', attributes='{}', params='{u'extra_env_variables': {u'ANSIBLE_REMOTE_TEMP': u'/tmp/file-mistral-action4twymF', u'ANSIBLE_LOCAL_TEMP': u'/tmp/file-mistral-actions60RY_', u'ANSIBLE_SSH_RETRIES': u'3', u'ANSIBLE_HOST_KEY_CHECKING': u'False'}, u'extra_vars': {u'amp_ssh_key_path': u'/home/stack/.ssh/id_rsa.pub', u'os_username': u'admin', u'os_identity_api_version': u'3', u'auth_username': u'octavia', u'amp_image_filename': u'/usr/share/rhosp-director-images/octavia-amphora.qcow2', u'auth_project_name': u'service', u'amp_image_name': u'octavia-amphora', u'os_auth_url': u'http://10.0.0.110:5000/v3', u'amp_ssh_key_name': u'octavia-ssh-key', u'os_project_name': u'admin', u'os_password': u'FMxBNfQEYrpE4EtPGcdDCdVyt', u'os_auth_type': u'password', u'auth_password': u'fZppAAjpVstZ2n8phZRQbUNbs', u'amp_image_tag': u'amphora-image'}, u'remote_user': u'stack', u'playbook': u'/usr/share/tripleo-common/playbooks/octavia-files.yaml', u'inventory': {u'undercloud': {u'hosts': {u'localhost': {u'ansible_connection': u'local'}}}}}']\n Unexpected error while running command.\nCommand: ansible-playbook -vvvvv /usr/share/tripleo-common/playbooks/octavia-files.yaml --user stack --extra-vars {\"amp_ssh_key_path\": \"/home/stack/.ssh/id_rsa.pub\", \"os_username\": \"admin\", \"os_identity_api_version\": \"3\", \"auth_username\": \"octavia\", \"amp_image_filename\": \"/usr/share/rhosp-director-images/octavia-amphora.qcow2\", \"auth_project_name\": \"service\", \"amp_image_name\": \"octavia-amphora\", \"os_auth_url\": \"http://10.0.0.110:5000/v3\", \"amp_ssh_key_name\": \"octavia-ssh-key\", \"os_project_name\": \"admin\", \"os_password\": \"***\", \"os_auth_type\": \"password\", \"auth_password\": \"***\", \"amp_image_tag\": \"amphora-image\"} --inventory-file /tmp/ansible-mistral-actionaJxZNw/inventory.yaml\nExit code: 4\nStdout: u\"ansible-playbook 2.4.3.0\\n config file = /tmp/ansible-mistral-actionaJxZNw/ansible.cfg\\n configured module search path = [u'/tmp/ansible-mistral-actionaJxZNw/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\\n ansible python module location = /usr/lib/python2.7/site-packages/ansible\\n executable location = /bin/ansible-playbook\\n python version = 2.7.5 (default, Feb 20 2018, 09:19:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\\nUsing /tmp/ansible-mistral-actionaJxZNw/ansible.cfg as config file\\nsetting up inventory plugins\\nSet default localhost to localhost\\nParsed /tmp/ansible-mistral-actionaJxZNw/inventory.yaml inventory source with yaml plugin\\n\"\nStderr: u'ERROR! Syntax Error while loading YAML.\\n\\n\\nThe error appears to have been in \\'/usr/share/openstack-tripleo-common/playbooks/roles/octavia-undercloud/tasks/main.yml\\': line 26, column 21, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n environment:\\n OS_USERNAME: {{ auth_username }}\\n ^ here\\nWe could be wrong, but this one looks like it might be an issue with\\nmissing quotes. Always quote template expression brackets when they\\nstart a value. For instance:\\n\\n with_items:\\n - {{ foo }}\\n\\nShould be written as:\\n\\n with_items:\\n - \"{{ foo }}\"\\n\\nexception type: <class \\'yaml.constructor.ConstructorError\\'>\\nexception: while constructing a mapping\\n in \"<unicode string>\", line 26, column 20\\nfound unacceptable key (unhashable type: \\'AnsibleMapping\\')\\n in \"<unicode string>\", line 26, column 21\\n'\n [action_ex_id=0bef89de-fc70-48a2-a39b-28363ece265c, idx=0]: Failed to run action [action_ex_id=0bef89de-fc70-48a2-a39b-28363ece265c, action_cls='<class 'mistral.actions.action_factory.AnsiblePlaybookAction'>', attributes='{}', params='{u'extra_env_variables': {u'ANSIBLE_REMOTE_TEMP': u'/tmp/file-mistral-action4twymF', u'ANSIBLE_LOCAL_TEMP': u'/tmp/file-mistral-actions60RY_', u'ANSIBLE_SSH_RETRIES': u'3', u'ANSIBLE_HOST_KEY_CHECKING': u'False'}, u'extra_vars': {u'amp_ssh_key_path': u'/home/stack/.ssh/id_rsa.pub', u'os_username': u'admin', u'os_identity_api_version': u'3', u'auth_username': u'octavia', u'amp_image_filename': u'/usr/share/rhosp-director-images/octavia-amphora.qcow2', u'auth_project_name': u'service', u'amp_image_name': u'octavia-amphora', u'os_auth_url': u'http://10.0.0.110:5000/v3', u'amp_ssh_key_name': u'octavia-ssh-key', u'os_project_name': u'admin', u'os_password': u'FMxBNfQEYrpE4EtPGcdDCdVyt', u'os_auth_type': u'password', u'auth_password': u'fZppAAjpVstZ2n8phZRQbUNbs', u'amp_image_tag': u'amphora-image'}, u'remote_user': u'stack', u'playbook': u'/usr/share/tripleo-common/playbooks/octavia-files.yaml', u'inventory': {u'undercloud': {u'hosts': {u'localhost': {u'ansible_connection': u'local'}}}}}']\n Unexpected error while running command.\nCommand: ansible-playbook -vvvvv /usr/share/tripleo-common/playbooks/octavia-files.yaml --user stack --extra-vars {\"amp_ssh_key_path\": \"/home/stack/.ssh/id_rsa.pub\", \"os_username\": \"admin\", \"os_identity_api_version\": \"3\", \"auth_username\": \"octavia\", \"amp_image_filename\": \"/usr/share/rhosp-director-images/octavia-amphora.qcow2\", \"auth_project_name\": \"service\", \"amp_image_name\": \"octavia-amphora\", \"os_auth_url\": \"http://10.0.0.110:5000/v3\", \"amp_ssh_key_name\": \"octavia-ssh-key\", \"os_project_name\": \"admin\", \"os_password\": \"***\", \"os_auth_type\": \"password\", \"auth_password\": \"***\", \"amp_image_tag\": \"amphora-image\"} --inventory-file /tmp/ansible-mistral-actionaJxZNw/inventory.yaml\nExit code: 4\nStdout: u\"ansible-playbook 2.4.3.0\\n config file = /tmp/ansible-mistral-actionaJxZNw/ansible.cfg\\n configured module search path = [u'/tmp/ansible-mistral-actionaJxZNw/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\\n ansible python module location = /usr/lib/python2.7/site-packages/ansible\\n executable location = /bin/ansible-playbook\\n python version = 2.7.5 (default, Feb 20 2018, 09:19:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\\nUsing /tmp/ansible-mistral-actionaJxZNw/ansible.cfg as config file\\nsetting up inventory plugins\\nSet default localhost to localhost\\nParsed /tmp/ansible-mistral-actionaJxZNw/inventory.yaml inventory source with yaml plugin\\n\"\nStderr: u'ERROR! Syntax Error while loading YAML.\\n\\n\\nThe error appears to have been in \\'/usr/share/openstack-tripleo-common/playbooks/roles/octavia-undercloud/tasks/main.yml\\': line 26, column 21, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n environment:\\n OS_USERNAME: {{ auth_username }}\\n ^ here\\nWe could be wrong, but this one looks like it might be an issue with\\nmissing quotes. Always quote template expression brackets when they\\nstart a value. For instance:\\n\\n with_items:\\n - {{ foo }}\\n\\nShould be written as:\\n\\n with_items:\\n - \"{{ foo }}\"\\n\\nexception type: <class \\'yaml.constructor.ConstructorError\\'>\\nexception: while constructing a mapping\\n in \"<unicode string>\", line 26, column 20\\nfound unacceptable key (unhashable type: \\'AnsibleMapping\\')\\n in \"<unicode string>\", line 26, column 21\\n'\n\n [wf_ex_id=c4da212b-4785-41ed-9a45-a344e368b4b2, idx=0]: Failure caused by error in tasks: upload_amphora\n\n upload_amphora [task_ex_id=40b5518e-0581-4192-85a6-e8f527c0ea13] -> Failed to run action [action_ex_id=0bef89de-fc70-48a2-a39b-28363ece265c, action_cls='<class 'mistral.actions.action_factory.AnsiblePlaybookAction'>', attributes='{}', params='{u'extra_env_variables': {u'ANSIBLE_REMOTE_TEMP': u'/tmp/file-mistral-action4twymF', u'ANSIBLE_LOCAL_TEMP': u'/tmp/file-mistral-actions60RY_', u'ANSIBLE_SSH_RETRIES': u'3', u'ANSIBLE_HOST_KEY_CHECKING': u'False'}, u'extra_vars': {u'amp_ssh_key_path': u'/home/stack/.ssh/id_rsa.pub', u'os_username': u'admin', u'os_identity_api_version': u'3', u'auth_username': u'octavia', u'amp_image_filename': u'/usr/share/rhosp-director-images/octavia-amphora.qcow2', u'auth_project_name': u'service', u'amp_image_name': u'octavia-amphora', u'os_auth_url': u'http://10.0.0.110:5000/v3', u'amp_ssh_key_name': u'octavia-ssh-key', u'os_project_name': u'admin', u'os_password': u'FMxBNfQEYrpE4EtPGcdDCdVyt', u'os_auth_type': u'password', u'auth_password': u'fZppAAjpVstZ2n8phZRQbUNbs', u'amp_image_tag': u'amphora-image'}, u'remote_user': u'stack', u'playbook': u'/usr/share/tripleo-common/playbooks/octavia-files.yaml', u'inventory': {u'undercloud': {u'hosts': {u'localhost': {u'ansible_connection': u'local'}}}}}']\n Unexpected error while running command.\nCommand: ansible-playbook -vvvvv /usr/share/tripleo-common/playbooks/octavia-files.yaml --user stack --extra-vars {\"amp_ssh_key_path\": \"/home/stack/.ssh/id_rsa.pub\", \"os_username\": \"admin\", \"os_identity_api_version\": \"3\", \"auth_username\": \"octavia\", \"amp_image_filename\": \"/usr/share/rhosp-director-images/octavia-amphora.qcow2\", \"auth_project_name\": \"service\", \"amp_image_name\": \"octavia-amphora\", \"os_auth_url\": \"http://10.0.0.110:5000/v3\", \"amp_ssh_key_name\": \"octavia-ssh-key\", \"os_project_name\": \"admin\", \"os_password\": \"***\", \"os_auth_type\": \"password\", \"auth_password\": \"***\", \"amp_image_tag\": \"amphora-image\"} --inventory-file /tmp/ansible-mistral-actionaJxZNw/inventory.yaml\nExit code: 4\nStdout: u\"ansible-playbook 2.4.3.0\\n config file = /tmp/ansible-mistral-actionaJxZNw/ansible.cfg\\n configured module search path = [u'/tmp/ansible-mistral-actionaJxZNw/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\\n ansible python module location = /usr/lib/python2.7/site-packages/ansible\\n executable location = /bin/ansible-playbook\\n python version = 2.7.5 (default, Feb 20 2018, 09:19:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\\nUsing /tmp/ansible-mistral-actionaJxZNw/ansible.cfg as config file\\nsetting up inventory plugins\\nSet default localhost to localhost\\nParsed /tmp/ansible-mistral-actionaJxZNw/inventory.yaml inventory source with yaml plugin\\n\"\nStderr: u'ERROR! Syntax Error while loading YAML.\\n\\n\\nThe error appears to have been in \\'/usr/share/openstack-tripleo-common/playbooks/roles/octavia-undercloud/tasks/main.yml\\': line 26, column 21, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n environment:\\n OS_USERNAME: {{ auth_username }}\\n ^ here\\nWe could be wrong, but this one looks like it might be an issue with\\nmissing quotes. Always quote template expression brackets when they\\nstart a value. For instance:\\n\\n with_items:\\n - {{ foo }}\\n\\nShould be written as:\\n\\n with_items:\\n - \"{{ foo }}\"\\n\\nexception type: <class \\'yaml.constructor.ConstructorError\\'>\\nexception: while constructing a mapping\\n in \"<unicode string>\", line 26, column 20\\nfound unacceptable key (unhashable type: \\'AnsibleMapping\\')\\n in \"<unicode string>\", line 26, column 21\\n'\n [action_ex_id=0bef89de-fc70-48a2-a39b-28363ece265c, idx=0]: Failed to run action [action_ex_id=0bef89de-fc70-48a2-a39b-28363ece265c, action_cls='<class 'mistral.actions.action_factory.AnsiblePlaybookAction'>', attributes='{}', params='{u'extra_env_variables': {u'ANSIBLE_REMOTE_TEMP': u'/tmp/file-mistral-action4twymF', u'ANSIBLE_LOCAL_TEMP': u'/tmp/file-mistral-actions60RY_', u'ANSIBLE_SSH_RETRIES': u'3', u'ANSIBLE_HOST_KEY_CHECKING': u'False'}, u'extra_vars': {u'amp_ssh_key_path': u'/home/stack/.ssh/id_rsa.pub', u'os_username': u'admin', u'os_identity_api_version': u'3', u'auth_username': u'octavia', u'amp_image_filename': u'/usr/share/rhosp-director-images/octavia-amphora.qcow2', u'auth_project_name': u'service', u'amp_image_name': u'octavia-amphora', u'os_auth_url': u'http://10.0.0.110:5000/v3', u'amp_ssh_key_name': u'octavia-ssh-key', u'os_project_name': u'admin', u'os_password': u'FMxBNfQEYrpE4EtPGcdDCdVyt', u'os_auth_type': u'password', u'auth_password': u'fZppAAjpVstZ2n8phZRQbUNbs', u'amp_image_tag': u'amphora-image'}, u'remote_user': u'stack', u'playbook': u'/usr/share/tripleo-common/playbooks/octavia-files.yaml', u'inventory': {u'undercloud': {u'hosts': {u'localhost': {u'ansible_connection': u'local'}}}}}']\n Unexpected error while running command.\nCommand: ansible-playbook -vvvvv /usr/share/tripleo-common/playbooks/octavia-files.yaml --user stack --extra-vars {\"amp_ssh_key_path\": \"/home/stack/.ssh/id_rsa.pub\", \"os_username\": \"admin\", \"os_identity_api_version\": \"3\", \"auth_username\": \"octavia\", \"amp_image_filename\": \"/usr/share/rhosp-director-images/octavia-amphora.qcow2\", \"auth_project_name\": \"service\", \"amp_image_name\": \"octavia-amphora\", \"os_auth_url\": \"http://10.0.0.110:5000/v3\", \"amp_ssh_key_name\": \"octavia-ssh-key\", \"os_project_name\": \"admin\", \"os_password\": \"***\", \"os_auth_type\": \"password\", \"auth_password\": \"***\", \"amp_image_tag\": \"amphora-image\"} --inventory-file /tmp/ansible-mistral-actionaJxZNw/inventory.yaml\nExit code: 4\nStdout: u\"ansible-playbook 2.4.3.0\\n config file = /tmp/ansible-mistral-actionaJxZNw/ansible.cfg\\n configured module search path = [u'/tmp/ansible-mistral-actionaJxZNw/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\\n ansible python module location = /usr/lib/python2.7/site-packages/ansible\\n executable location = /bin/ansible-playbook\\n python version = 2.7.5 (default, Feb 20 2018, 09:19:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]\\nUsing /tmp/ansible-mistral-actionaJxZNw/ansible.cfg as config file\\nsetting up inventory plugins\\nSet default localhost to localhost\\nParsed /tmp/ansible-mistral-actionaJxZNw/inventory.yaml inventory source with yaml plugin\\n\"\nStderr: u'ERROR! Syntax Error while loading YAML.\\n\\n\\nThe error appears to have been in \\'/usr/share/openstack-tripleo-common/playbooks/roles/octavia-undercloud/tasks/main.yml\\': line 26, column 21, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n environment:\\n OS_USERNAME: {{ auth_username }}\\n ^ here\\nWe could be wrong, but this one looks like it might be an issue with\\nmissing quotes. Always quote template expression brackets when they\\nstart a value. For instance:\\n\\n with_items:\\n - {{ foo }}\\n\\nShould be written as:\\n\\n with_items:\\n - \"{{ foo }}\"\\n\\nexception type: <class \\'yaml.constructor.ConstructorError\\'>\\nexception: while constructing a mapping\\n in \"<unicode string>\", line 26, column 20\\nfound unacceptable key (unhashable type: \\'AnsibleMapping\\')\\n in \"<unicode string>\", line 26, column 21\\n'\n\n"

tags: added: queens-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

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

Changed in tripleo:
assignee: nobody → Carlos Goncalves (cgoncalves)
status: New → In Progress
Changed in tripleo:
assignee: Carlos Goncalves (cgoncalves) → Nir Magnezi (nmagnezi)
Changed in tripleo:
importance: Undecided → Medium
milestone: none → rocky-2
Changed in tripleo:
assignee: Nir Magnezi (nmagnezi) → Carlos Goncalves (cgoncalves)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/567205
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=8a69b692c4bdf3b5b7b32907ea8f117c194058b3
Submitter: Zuul
Branch: master

commit 8a69b692c4bdf3b5b7b32907ea8f117c194058b3
Author: Carlos Goncalves <email address hidden>
Date: Wed May 9 14:06:22 2018 +0200

    Check pub key file perms and default to pub key data

    The previously default /home/stack/.ssh/id_rsa.pub file may not exist or
    be readable; exit with explicit error message. Users can still specify a
    file path but will need to ensure it is readable. Should a file path not
    be specified, default to amp_ssh_key_data. The value is passed by THT
    with the public key of the 'default' keypair from the undercloud which
    anyway is the public key of the 'stack' user.

    This patch also fixes a syntax error in octavia-undercloud role.

    Closes-Bug: #1770153
    Closes-Bug: #1770641

    Depends-On: https://review.openstack.org/568022
    Change-Id: I0026343d90b84572c3002fa21001cfb09c742391

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/568394

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/queens)

Reviewed: https://review.openstack.org/568394
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=a2a55395795e3ac67c778c4f8e81b964ea509f43
Submitter: Zuul
Branch: stable/queens

commit a2a55395795e3ac67c778c4f8e81b964ea509f43
Author: Carlos Goncalves <email address hidden>
Date: Wed May 9 14:06:22 2018 +0200

    Check pub key file perms and default to pub key data

    The previously default /home/stack/.ssh/id_rsa.pub file may not exist or
    be readable; exit with explicit error message. Users can still specify a
    file path but will need to ensure it is readable. Should a file path not
    be specified, default to amp_ssh_key_data. The value is passed by THT
    with the public key of the 'default' keypair from the undercloud which
    anyway is the public key of the 'stack' user.

    This patch also fixes a syntax error in octavia-undercloud role.

    Closes-Bug: #1770153
    Closes-Bug: #1770641

    Depends-On: https://review.openstack.org/568022
    Change-Id: I0026343d90b84572c3002fa21001cfb09c742391
    (cherry picked from commit 8a69b692c4bdf3b5b7b32907ea8f117c194058b3)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 8.6.2

This issue was fixed in the openstack/tripleo-common 8.6.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 9.1.0

This issue was fixed in the openstack/tripleo-common 9.1.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.