Awx: AWXKit export/import - job template surveys

Created on 11 Aug 2020  路  4Comments  路  Source: ansible/awx

ISSUE TYPE
  • Bug Report
SUMMARY

When exporting job templates from once AWX instance and importing them into another new instance, job templates lose associated surveys.

ENVIRONMENT
  • AWX version: 14.0.0
  • AWX install method: docker on linux
  • Ansible version: 2.9.11
  • Operating System: Ubuntu 18.04
  • Web Browser: Chrome

The above is for the new instance. The old instance is AWX 7.0.0 with Ansible 2.8.4, all other environment items are the same for the old instance.

STEPS TO REPRODUCE
  1. export job templates from existing system: awx export -k --job_templates > job_templates.json
  2. import job templates to new system: awx import -k < job_templates.json
EXPECTED RESULTS

Job templates are imported with surveys

ACTUAL RESULTS

Surveys are empty.

ADDITIONAL INFORMATION

Exported job template survey:

image

image

Imported job template survey:

image

image

api cli medium blocked needs_info bug

All 4 comments

@watsonb I'm also having problems replicating this one. Here's a successful import with an absolute minimum survey question:

Screenshot_2020-10-08 Ansible AWX Demo Job Template 4

My example json file:

{
     "job_templates": [
          {
               "name": "Demo Job Template 4",
               "description": "",
               "job_type": "run",
               "playbook": "hello_world.yml",
               "scm_branch": "",
               "forks": 0,
               "limit": "",
               "verbosity": 0,
               "extra_vars": "",
               "job_tags": "",
               "force_handlers": false,
               "skip_tags": "",
               "start_at_task": "",
               "timeout": 0,
               "use_fact_cache": false,
               "host_config_key": "",
               "ask_scm_branch_on_launch": false,
               "ask_diff_mode_on_launch": false,
               "ask_variables_on_launch": false,
               "ask_limit_on_launch": false,
               "ask_tags_on_launch": false,
               "ask_skip_tags_on_launch": false,
               "ask_job_type_on_launch": false,
               "ask_verbosity_on_launch": false,
               "ask_inventory_on_launch": false,
               "ask_credential_on_launch": false,
               "survey_enabled": true,
               "become_enabled": false,
               "diff_mode": false,
               "allow_simultaneous": false,
               "custom_virtualenv": null,
               "job_slice_count": 1,
               "webhook_service": "",
               "webhook_credential": null,
               "inventory": {
                    "organization": {
                         "name": "Default",
                         "type": "organization"
                    },
                    "name": "Demo Inventory",
                    "type": "inventory"
               },
               "project": {
                    "organization": {
                         "name": "Default",
                         "type": "organization"
                    },
                    "name": "Demo Project",
                    "type": "project"
               },
               "related": {
                    "labels": [],
                    "credentials": [
                         {
                              "organization": null,
                              "name": "Demo Credential 2",
                              "credential_type": {
                                   "name": "Machine",
                                   "kind": "ssh",
                                   "type": "credential_type"
                              },
                              "type": "credential"
                         }
                    ],
                    "schedules": [],
                    "notification_templates_started": [],
                    "notification_templates_success": [],
                    "notification_templates_error": [],
                    "survey_spec": {
                         "name": "",
                         "description": "",
                         "spec": [
                              {
                                   "question_name": "Foo",
                                   "question_description": "",
                                   "required": true,
                                   "type": "text",
                                   "variable": "foo",
                                   "min": 0,
                                   "max": 1024,
                                   "default": "",
                                   "choices": "",
                                   "new_question": true
                              }
                         ]
                    }
               },
               "natural_key": {
                    "organization": {
                         "name": "Default",
                         "type": "organization"
                    },
                    "name": "Demo Job Template 4",
                    "type": "job_template"
               }
          }
     ]
}

I'll try to run the export/import again on a fresh new instance and capture exported *.json files that are being imported for review.

@jbradberry I provisioned a fresh AWX 15.0.0 installation and the export/import worked this time (using awxkit==15.0.0) with respect to this issue. I consider it closed.

Was this page helpful?
0 / 5 - 0 ratings