Description:
When using PreNetworkConfig, hiera.yaml output is wrong(ansible output is getting injected into hiera.yaml)
Background:
To test PreNetworkConfig interface in CI, we have defined a simple resource[1] in PreNetwork configuration but the deployment with PreNetworkConfig is failing because of wrong hiera.yaml content
~~~
Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'lookup_options' failed: The Lookup Configuration at '/etc/puppet/hiera.yaml' has wrong type, unrecognized key 'changed'
~~~
[1] https://review.opendev.org/c/openstack/tripleo-heat-templates/+/798254
[2] https://review.rdoproject.org/r/c/testproject/+/31954/4/.zuul.yaml
Error snippet:-
https://logserver.rdoproject.org/54/31954/4/check/tripleo-ci-centos-8-ovb-3ctlr_1comp-featureset001-with-pre/06e5df1/logs/undercloud/home/zuul/overcloud_deploy.log.txt.gz
~~~
2021-06-28 10:11:43 | 2021-06-28 10:11:43.620289 | fa163e53-a6c3-6ad8-3f05-000000003a6d | FATAL | Wait for puppet host configuration to finish | overcloud-novacompute-0 | error={"ansible_job_id": "519918335459.20733", "attempts": 4, "changed": true, "cmd": "set -o pipefail; puppet apply --modulepath=/etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --detailed-exitcodes --summarize --color=false /var/lib/tripleo-config/puppet_step_config.pp 2>&1 | logger -s -t puppet-user", "delta": "0:00:07.914990", "end": "2021-06-28 10:11:41.235447", "failed_when_result": true, "finished": 1, "msg": "non-zero return code", "rc": 1, "start": "2021-06-28 10:11:33.320457", "stderr": "<13>Jun 28 10:11:33 puppet-user: Warning: /etc/puppet/hiera.yaml: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5
<13>Jun 28 10:11:41 puppet-user: (file: /etc/puppet/hiera.yaml)
<13>Jun 28 10:11:41 puppet-user: Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'lookup_options' failed: The Lookup Configuration at '/etc/puppet/hiera.yaml' has wrong type, unrecognized key 'changed'
<13>Jun 28 10:11:41 puppet-user: The Lookup Configuration at '/etc/puppet/hiera.yaml' has wrong type, unrecognized key 'skip_reason'
<13>Jun 28 10:11:41 puppet-user: The Lookup Configuration at '/etc/puppet/hiera.yaml' has wrong type, unrecognized key 'skipped' (file: /var/lib/tripleo-config/puppet_step_config.pp, line: 1, column: 1) on node overcloud-novacompute-0.localdomain", "stderr_lines": ["<13>Jun 28 10:11:33 puppet-user: Warning: /etc/puppet/hiera.yaml: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5", "<13>Jun 28 10:11:41 puppet-user: (file: /etc/puppet/hiera.yaml)", "<13>Jun 28 10:11:41 puppet-user: Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'lookup_options' failed: The Lookup Configuration at '/etc/puppet/hiera.yaml' has wrong type, unrecognized key 'changed'", "<13>Jun 28 10:11:41 puppet-user: The Lookup Configuration at '/etc/puppet/hiera.yaml' has wrong type, unrecognized key 'skip_reason'", "<13>Jun 28 10:11:41 puppet-user: The Lookup Configuration at '/etc/puppet/hiera.yaml' has wrong type, unrecognized key 'skipped' (file: /var/lib/tripleo-config/puppet_step_config.pp, line: 1, column: 1) on node overcloud-novacompute-0.localdomain"], "stdout": "", "stdout_lines": []
~~~
ansible output is getting injected into hiera.yaml
https://logserver.rdoproject.org/54/31954/4/check/tripleo-ci-centos-8-ovb-3ctlr_1comp-featureset001-with-pre/06e5df1/logs/overcloud-novacompute-0/etc/puppet/hiera.yaml.txt.gz
~~~
---
:backends:
- json
:json:
:datadir: /etc/puppet/hieradata
:hierarchy:
changed: false
skip_reason: Conditional result was False
skipped: true
~~~
Fix proposed to branch: master /review. opendev. org/c/openstack /tripleo- common/ +/798343
Review: https:/