简体   繁体   中英

Can you create a reusable survey question in Ansible Tower?

Creating surveys is pretty straightforward, as is using their results in templates/jobs. However, I am finding that I have a survey that I keep having to recreate. Is it possible to create one that could then be re-used across multiple templates?

What you could do is that you could use the controller/tower/awx collection, and from that the job_template module, which has a survey_spec option. In other words: you could create a playbook/job template, that updates/creates other job templates and adds the survey.

Here the module: https://docs.ansible.com/ansible/latest/collections/awx/awx/job_template_module.html#ansible-collections-awx-awx-job-template-module

...and here's how to define the survey_spec: https://docs.ansible.com/automation-controller/latest/html/controllerapi/api_ref.html#/Job_Templates/Job_Templates_job_templates_survey_spec_list

With this you practically automate your tower/controller/awx config.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM