# tower\_send throws error with survey multiple-choice

**URL:** <https://forum.ansible.com/t/tower-send-throws-error-with-survey-multiple-choice/33794>\
**Category:** AWX Project\
**Tags:** rhel, awx, galaxy-ng\
**Created:** [September 11, 2020, 8:10pm UTC](https://forum.ansible.com/t/tower-send-throws-error-with-survey-multiple-choice/33794 "2020-09-11T20:10:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Farrar](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@Daniel\_Farrar](https://forum.ansible.com/u/Daniel_Farrar)\
**Post date:** [September 11, 2020, 8:10pm UTC](https://forum.ansible.com/t/tower-send-throws-error-with-survey-multiple-choice/33794/1 "2020-09-11T20:10:20Z")

</div>

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](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:](http://localhost/api/v2/job_templates/168/survey_spec/%5CnParams:) 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”,  
“”  
],

---

<div class="post-metadata">

**Author:** ![Daniel\_Farrar](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@Daniel\_Farrar](https://forum.ansible.com/u/Daniel_Farrar)\
**Post date:** [September 15, 2020, 5:31pm UTC](https://forum.ansible.com/t/tower-send-throws-error-with-survey-multiple-choice/33794/2 "2020-09-15T17:31:11Z")

</div>

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}}”
