output of group vars that are not string/ints may include python encoding
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Fix Released
|
High
|
Alex Schultz |
Bug Description
While implementing the chrony works, the group vars for it are including the python encoding which breaks the configuration files. I tracked this down to the group vars file for the role which looked like:
chrony_role_action: all
chrony_
chrony_
any_errors_fatal: True
chrony_ntp_servers: []
max_fail_
chrony_
chrony_ntp_pools: [u'pool.ntp.org']
chrony_acl_rules: [u'deny all']
The ntp pools/and acl rules are arrays of strings from heat. When we output it to a file, it maintains the encoding and ansible will write it out as a string (Example, u'pool.ntp.org')
Teh config file ends up like...
[zuul@subnode-0 ~]$ cat /etc/chrony.conf
# Do not manually edit this file.
# Managed by ansible-role-chrony
server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst
pool u'pool.ntp.org' iburst minpoll 6 maxpoll 10
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
u'deny all'
driftfile /var/lib/
logdir /var/log/chrony
rtcsync
makestep 1.0 3
This appears to be because we are outputting the vars using a jinja template rather than properly outputting yaml.
Fix proposed to branch: master /review. openstack. org/614876
Review: https:/