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

Survey import/export - multi select answer issue default choices #847

Closed
przemkalit opened this issue Jun 25, 2024 · 0 comments · Fixed by #900
Closed

Survey import/export - multi select answer issue default choices #847

przemkalit opened this issue Jun 25, 2024 · 0 comments · Fixed by #900
Assignees
Labels
bug Something isn't working filetree/filetree_create new New issue, this should be removed once reviewed

Comments

@przemkalit
Copy link
Contributor

Summary

When importing the exported (with filetree_create) job template using this collection we are receiving error:

Failed to update survey: Default choice must be answered from the choices listed.

Issue Type

  • Bug Report

Ansible, Collection, Controller details

ansible --version

ansible [core 2.16.2]
  config file = None
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
  ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.12.1 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] (/usr/bin/python3)
  jinja version = 3.1.3
  libyaml = True

ansible-galaxy collection list
Collection              Version
----------------------- -------
ansible.posix           1.5.4
ansible.windows         2.2.0
awx.awx                 23.6.0
containers.podman       1.11.0
kubernetes.core         3.0.0
redhatinsights.insights 1.2.2
theforeman.foreman      4.0.0

Controller version  4.5.6 
  • ansible installation method: EE

OS / ENVIRONMENT

Red Hat

Desired Behavior

Job template is imported with proper default choices.

Actual Behavior

{
  "started": 1,
  "finished": 1,
  "stdout": "",
  "stderr": "",
  "stdout_lines": [],
  "stderr_lines": [],
  "ansible_job_id": "j481293389279.902",
  "results_file": "/root/.ansible_async/j481293389279.902",
  "msg": "Failed to update survey: Default choice must be answered from the choices listed.",
...
      "survey_spec": {
        "description": "",
        "name": "",
        "spec": [
          {
            "choices": [
              "organizations",
              "job_templates",
              "projects",
              "workflow_job_templates",
              "credentials",
              "notification_templates",
              "instance_groups",
              "credential_types",
              "labels",
              "users",
              "teams",
              "roles",
              "hosts"
            ],
            "default": "organizations\\njob_templates\\nprojects\\nworkflow_job_templates\\ncredentials\\nnotification_templates\\ninstance_groups\\ncredential_types\\nlabels\\nusers\\nteams\\nroles\\nhosts",
            "max": 1024,
            "min": 0,
            "new_question": false,
            "question_description": "",
            "question_name": "Objects to restore",
            "required": true,
            "type": "multiselect",
            "variable": "input_tag"
          }

STEPS TO REPRODUCE

  1. Create job template with survey that have a multi select answer.
  2. Pick two or more answers for the question.
  3. Export the job with filetree_create role.
  4. Import using filetree_read and dispatch roles

backup.yaml

---
- name: Backup all objects
  hosts: localhost
  connection: local
  gather_facts: false
  vars:
    controller_oauthtoken: "{{ lookup('ansible.builtin.env', 'TOWER_OAUTH_TOKEN') }}"
    controller_hostname: "{{ lookup('ansible.builtin.env', 'TOWER_HOST') }}"
    controller_validate_certs: "{{ lookup('ansible.builtin.env', 'TOWER_VERIFY_SSL') }}"
  roles:
    - infra.controller_configuration.filetree_create

restore.yaml

---
- name: Restore all objects
  hosts: localhost
  connection: local
  gather_facts: false
  vars:
    controller_oauthtoken: "{{ lookup('ansible.builtin.env', 'TOWER_OAUTH_TOKEN) }}"
    controller_hostname: "{{ lookup('ansible.builtin.env', 'TOWER_HOST') }}"
    controller_validate_certs: "{{ lookup('ansible.builtin.env', 'TOWER_VERIFY_SSL') }}"
  tasks:
    - name: Include vars from control_vars directory
      ansible.builtin.include_vars:
        dir: "{{ dir_orgs_vars }}"
        extensions:
          - "yml"
          - "yaml"

    - ansible.builtin.include_role:
      name: infra.controller_configuration.filetree_read
    
    - ansible.builtin.include_role:
      name: infra.controller_configuration.dispatch
@przemkalit przemkalit added bug Something isn't working new New issue, this should be removed once reviewed labels Jun 25, 2024
@ivarmu ivarmu self-assigned this Sep 5, 2024
Tompage1994 added a commit that referenced this issue Sep 5, 2024
* fixed the issue

* Update galaxy.yml

Co-authored-by: Tom Page <tompage1994@hotmail.co.uk>

---------

Co-authored-by: Tom Page <tompage1994@hotmail.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working filetree/filetree_create new New issue, this should be removed once reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants