config_template broken on ansible 2.3?

Bug #1707265 reported by Logan V
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Logan V

Bug Description

The openstack_user_config_overrides defined in https://gist.githubusercontent.com/Logan2211/61395dfd05af1819673bb5232d14077f/raw/d33878dc906913a9fba19635a2787556fa5f2422/bootstrap_host_overrides.yml and being consumed here https://github.com/openstack/openstack-ansible/blob/b55fc7240d31732d38119c421b479cd3f426e669/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml#L38-L46 is not working on either python2.7 or python3 in master w/ ansible 2.3.

With ansible verbosity increased, the output looks like:
TASK [bootstrap-host : Deploy openstack_user_config] ***************************
task path: /home/ubuntu/workspace/openstack-upstream/openstack-ansible/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml:38
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~ && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1501255690.69-280917705831294 `" && echo ansible-tmp-1501255690.69-280917705831294="` echo /root/.ansible/tmp/ansible-tmp-1501255690.69-280917705831294 `" ) && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 125, in run
    res = self._execute()
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 522, in _execute
    result = self._handler.run(task_vars=variables)
  File "/etc/ansible/roles/plugins/action/_v2_config_template.py", line 598, in run
    ignore_none_type=_vars.get('ignore_none_type', True)
  File "/etc/ansible/roles/plugins/action/_v2_config_template.py", line 407, in return_config_overrides_yaml
    width=1000,
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/__init__.py", line 202, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/__init__.py", line 190, in dump_all
    dumper.represent(data)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 28, in represent
    node = self.represent_data(data)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 225, in represent_dict
    return self.represent_mapping(u'tag:yaml.org,2002:map', data)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 123, in represent_mapping
    node_value = self.represent_data(item_value)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 57, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 225, in represent_dict
    return self.represent_mapping(u'tag:yaml.org,2002:map', data)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 123, in represent_mapping
    node_value = self.represent_data(item_value)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 67, in represent_data
    node = self.yaml_representers[None](self, data)
  File "/opt/ansible-runtime/local/lib/python2.7/site-packages/yaml/representer.py", line 249, in represent_undefined
    raise RepresenterError("cannot represent an object: %s" % data)
RepresenterError: cannot represent an object: 172.29.236.0/22

Revision history for this message
Logan V (loganv) wrote :
Revision history for this message
Logan V (loganv) wrote :

https://review.openstack.org/#/c/489660 reproduces this and has some additional notes about this issue.

Changed in openstack-ansible:
assignee: nobody → Logan V (loganv)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-plugins (master)

Reviewed: https://review.openstack.org/489660
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible-plugins/commit/?id=6d496d6c5bdeb47be0e56bf06676755da2db2aea
Submitter: Jenkins
Branch: master

commit 6d496d6c5bdeb47be0e56bf06676755da2db2aea
Author: Logan V <email address hidden>
Date: Tue Aug 1 11:36:46 2017 -0500

    Fix dumping hostvars to yaml from overrides

    Using AnsibleDumper adds support for dumping the internal ansible
    data types that are used in hostvars.

    Fixes-Bug: #1707265
    Change-Id: Ie59bbef31306cd3e99aa827db875922e17084e83

Changed in openstack-ansible:
status: In Progress → Fix Released
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.