diodonfrost / ansible-role-puppet-agent

Ansible role for manage puppet-agent on a large number of os
Apache License 2.0
5 stars 9 forks source link

Problem with puppet_agent_custom_options #3

Closed kpu32167 closed 3 years ago

kpu32167 commented 4 years ago
SUMMARY

When I try to use puppet_agent_custom_options I got something like this [u'certname = test.ansible3', u'daemonize = true']

STEPS TO REPRODUCE
- hosts: init_puppet
  become: yes
  roles:
    - role: diodonfrost.puppet_agent
      vars:
        - company_tag: "test"
        - puppet_version: "6"
        - puppet_agent_server: puppet.some.domain
        - puppet_agent_custom_options:
            - certname = {{ company_tag }}.{{ ansible_hostname }}
            - daemonize = true
EXPECTED RESULTS
#####################################
##                                 ##
## THIS FILE IS MANAGED BY ANSIBLE ##
##                                 ##
#####################################

[main]
server = puppet.some.domain
environment = production
runinterval = 30m

certname = test.ansible3
daemonize = true
ACTUAL RESULTS
#####################################
##                                 ##
## THIS FILE IS MANAGED BY ANSIBLE ##
##                                 ##
#####################################

[main]
server = puppet.some.domain
environment = production
runinterval = 30m

[u'certname = test.ansible3', u'daemonize = true']
ENVIRONMENT
HOW I FIXED IT

Changed in puppet.conf.j2 {{ puppet_agent_custom_options }}
to {% for custom_option in (puppet_agent_custom_options | from_yaml) %}
{{ custom_option }}
{% endfor %}

diodonfrost commented 4 years ago

Thanks for the report, I'll have a look

diodonfrost commented 4 years ago

Fixed in version 1.6.0