tower_send throws error with survey multiple-choice

Hello! I’m using the awx.awx.tower_send and awx.awx.tower_receive ansible modules trying to export a config from one AWX environment into another. This works with most parts of a config except for multiplechoice surveys, which error out with “The min limit in survey question 0 expected to be integer” where “min == None” currently and not an integer. Tested on AWX 9.3.0 and 14.1.0 with matching versions of the awx.awx galaxy modules and the host running ansible-tower-cli==3.3.9. This issue was also referenced in this ansible/ansible Github issue:
https://github.com/ansible/ansible/issues/68188

I see in that Github issue a reference by @AlanCoding to new modules in the works, is this item broken until those AWX send/receive modules are completed? Of course the awx-cli doesn’t have send/receive feature that the tower-cli currently does.

Thank you for your help with this and support of this project!

“msg”: “The Tower server claims it was sent a bad request.\n\nPOST http://localhost/api/v2/job_templates/168/survey_spec/\nParams: None\nData: {"name": "", "description": "", "spec": [{"question_name": "Bounce_server", "question_description": "", "required": true, "type": "multiplechoice", "variable": "bounce_server", "min": "None", "max": "None", "default": "false", "choices": "true\\nfalse", "new_question": true}]}\n\nResponse: {"error":"The min limit in survey question 0 expected to be integer."}”,
“output”: [
“”,
“JOB TEMPLATE [PATCHING - RHEL Patching] *****************************”,
“Asset up to date”,
“Updating survey”,
“”
],

Well I found a workaround for now mixing the tower_receive module with the shell tower-cli send, using the tower_receive module to loop through jobs and send the job name one by one to tower-cli send --tower-host destination_host. Looking forward to using the new AWX CLI when it’s ready!

  • name: List source tower_job_templates
    awx.awx.tower_receive:
    job_template:

  • all
    register: jobs

  • include: awx_send_jobs.yml
    with_items: “{{jobs.assets}}”
    when:

  • item.asset_relation.labels[0].name is defined

  • item.asset_relation.labels[0].name == “PRODUCTION”

awx_send_jobs.yml:

  • name: list production job name
    debug:
    msg: “{{ item.name }}”

  • name: Run AWX Backup on Job name
    shell: tower-cli receive --job_template “{{item.name}}” > /home/user/job_send.json

  • name: remove schedule from Job
    shell: sed -i ‘/^\s\s\s\s\s\s"schedules"/d’ /home/user/job_send.json

  • name: Send Job to other host
    shell: tower-cli send /home/user/job_send.json --tower-host “{{destination_host}}”