ansible / tower-cli

THIS TOOL IS NO LONGER UNDER ACTIVE DEVELOPMENT. This tool is being phased out in favor of the new official AWX CLI
https://github.com/ansible/awx/tree/devel/awxkit/awxkit/cli/docs
Apache License 2.0
362 stars 151 forks source link

Nested workflows using tower modules #670

Open puneethkosaraju opened 5 years ago

puneethkosaraju commented 5 years ago

This is related to Issue #649

Hi, the fix is not working in the ansible module tower_workflow_template. Any suggestions ?

Details:

"Tower CLI 3.3.2",
"API v2",
"AWX 2.1.2-35-gc5d1ea886",
"Ansible 2.7.8"

AWX Task

- name: Create AWX Workflows
  tower_workflow_template:
    name: "{{item.name}}"
    description: "{{item.description}}"
    organization: "{{item.organization}}"
    schema: "{{item.node_network | to_nice_yaml}}"
    allow_simultaneous: "{{item.allow_simultaneous}}"
    tower_verify_ssl: "{{awx_verify_ssl_enabled}}"
    state: "present"

Stacktrace:

"module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1551478645.0038295-169619328035719/AnsiballZ_tower_workflow_template.py\", line 113, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1551478645.0038295-169619328035719/AnsiballZ_tower_workflow_template.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1551478645.0038295-169619328035719/AnsiballZ_tower_workflow_template.py\", line 48, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/usr/lib64/python3.6/imp.py\", line 235, in load_module\n return load_source(name, filename, file)\n File \"/usr/lib64/python3.6/imp.py\", line 170, in load_source\n module = _exec(spec, sys.modules[name])\n File \"<frozen importlib._bootstrap>\", line 618, in _exec\n File \"<frozen importlib._bootstrap_external>\", line 678, in exec_module\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"/tmp/ansible_tower_workflow_template_payload__lnjwga7/__main__.py\", line 191, in <module>\n File \"/tmp/ansible_tower_workflow_template_payload__lnjwga7/__main__.py\", line 178, in main\n File \"/usr/local/lib/python3.6/site-packages/tower_cli/resources/workflow.py\", line 279, in schema\n existing_network = self._get_schema(wfjt)\n File \"/usr/local/lib/python3.6/site-packages/tower_cli/resources/workflow.py\", line 254, in _get_schema\n return self._workflow_node_structure(node_results)\n File \"/usr/local/lib/python3.6/site-packages/tower_cli/resources/workflow.py\", line 243, in _workflow_node_structure\n schema_dict.append(branch_schema(root_node_id))\n File \"/usr/local/lib/python3.6/site-packages/tower_cli/resources/workflow.py\", line 226, in branch_schema\n ujt_key = JOB_TYPES[job_type]\nKeyError: 'workflow_job'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

AlanCoding commented 5 years ago

It would help to know what is being used in schema: "{{item.node_network | to_nice_yaml}}". I can't find any indication in the prior issue https://github.com/ansible/tower-cli/issues/649