Summary
If a job template contains a survey, when filetree_create export the job template it does not add quotes to the question_name key of each question
For example, if a survey question looks like: please chose between: Value1 and Value2
The resulting export will look like :
survey_spec:
name: ""
spec:
- max: 1024
min: 0
type: text
required: True
variable: vm_name
new_question: True
question_name: please chose between: Value1 and Value2
description: ""
become_enabled: false
diff_mode: false
which is not correct YAML and cause errors when using the generated variable file.
The solution is to quote the value of question_name
Issue Type
Ansible, Collection, Controller details
ansible --version
ansible [core 2.18.12]
config file = /home/w4hf/projects/CAC/cac-create-24/ansible.cfg
configured module search path = ['/home/w4hf/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.14/site-packages/ansible
ansible collection location = /home/w4hf/projects/CAC/cac-create-24/collections
executable location = /usr/bin/ansible
python version = 3.14.2 (main, Dec 5 2025, 00:00:00) [GCC 15.2.1 20251111 (Red Hat 15.2.1-4)] (/usr/bin/python3)
jinja version = 3.1.6
libyaml = True
ansible-galaxy collection list
# /home/w4hf/projects/CAC/cac-create-24/collections/ansible_collections
Collection Version
------------------------------ -------
ansible.controller 4.5.25
infra.controller_configuration 3.2.0
Controller version
4.5.25
Desired Behavior
Generated file after export should be valid yaml
Actual Behavior
Exported file is not valid yaml if the survey contains unvalid yaml strings like strings that contains ': '
STEPS TO REPRODUCE
- Create a job template with a survey with the following question name
question_name: please chose between: Value1 and Value2
-
export job_tempaltes using filetree_create
-
see that question_name has an invalid yaml
Summary
If a job template contains a survey, when
filetree_createexport the job template it does not add quotes to thequestion_namekey of each questionFor example, if a survey question looks like:
please chose between: Value1 and Value2The resulting export will look like :
which is not correct YAML and cause errors when using the generated variable file.
The solution is to quote the value of question_name
Issue Type
Ansible, Collection, Controller details
Desired Behavior
Generated file after export should be valid yaml
Actual Behavior
Exported file is not valid yaml if the survey contains unvalid yaml strings like strings that contains ': '
STEPS TO REPRODUCE
export job_tempaltes using
filetree_createsee that
question_namehas an invalid yaml