Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tower_send unable to process job template with multiple choice (single select) prompt #68188

Closed
seamlesstesterWS1 opened this issue Mar 12, 2020 · 3 comments
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. module This issue/PR relates to a module. python3 support:community This issue/PR relates to code supported by the Ansible community. tower Tower community web_infrastructure Web-infrastructure category

Comments

@seamlesstesterWS1
Copy link

SUMMARY

tower_send module unable to process job templates that leverage survey's with Multiple Choice (single select) prompts.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

tower_send

ANSIBLE VERSION
ansible 2.9.6
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Aug  7 2019, 17:28:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

CONFIGURATION

OS / ENVIRONMENT

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

AWX Version: 9.2.0

STEPS TO REPRODUCE

Create a job template with a survey. Within the survey, add a multiple choice (single select) prompt. Export the job template using the tower_receive module. Import the configuration using the tower_send module.

 - name: "Gather Configurations from Source Tower"
     tower_receive:
       tower_host: "{{ sourceTowerUrl }}"
       tower_username: "{{ sourceTowerUsername }}"
       tower_password: "{{ sourceTowerPassword }}"
       validate_certs: no
       job_template:  ["Template with MC Survey Option"]
     register: sourceTowerConfig
- name: "Import Configurations into Destination Tower"
     tower_send:
       assets: "{{ sourceTowerConfig.assets }}"
       tower_host: "{{ destinationTowerUrl }}"
       tower_username: "{{ destinationTowerUsername }}"
       tower_password: "{{ destinationTowerPassword }}"
       validate_certs: no
EXPECTED RESULTS

Job template is imported to destination tower with survey intact.

ACTUAL RESULTS

See stack below:

"msg": "The Tower server claims it was sent a bad request.\n\nPOST https://awx-mig.test.net/api/v2/job_templates/17/survey_spec/\nParams: None\nData: {\"description\": \"\", \"spec\": [{\"required\": true, \"min\": \"None\", \"default\": \"a\", \"max\": \"None\", \"question_description\": \"\", \"choices\": \"a\\\\nb\\\\nc\", \"new_question\": true, \"variable\": \"mcOption\", \"question_name\": \"MC Option\", \"type\": \"multiplechoice\"}], \"name\": \"\"}\n\nResponse: {\"error\":\"The min limit in survey question 0 expected to be integer.\"}",

@ansibot
Copy link
Contributor

ansibot commented Mar 12, 2020

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. python3 support:community This issue/PR relates to code supported by the Ansible community. tower Tower community web_infrastructure Web-infrastructure category labels Mar 12, 2020
@AlanCoding
Copy link
Member

Those modules have moved here:

https://github.com/ansible/awx/tree/devel/awx_collection
https://galaxy.ansible.com/awx/awx

Within a few weeks, they will be deleted. The issue tracker is now the AWX issue tracker.

The send / receive modules were wrappers around the tower-cli library which is deprecated.

A replacement is in the works at ansible/awx#6125. That will replace the tower_send and tower_receive functionality with new modules and those will be marked as deprecated.

close_me

@ansibot ansibot closed this as completed Mar 12, 2020
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Mar 17, 2020
@ansible ansible locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. module This issue/PR relates to a module. python3 support:community This issue/PR relates to code supported by the Ansible community. tower Tower community web_infrastructure Web-infrastructure category
Projects
None yet
Development

No branches or pull requests

4 participants