Skip to content
Snippets Groups Projects
Commit aba0bd30 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Pass ztp_stack var to trigger_ztp_configuration

New variable required to generate ZTP configuration.
Note that we can only pass strings with extra_vars in AWX API (no list
or dict).

JIRA INFRA-458 #action In Progress
parent b5f52d9f
No related branches found
No related tags found
No related merge requests found
......@@ -120,11 +120,13 @@ def trigger_vm_creation(name, interface, memory, cores):
def trigger_ztp_configuration(host):
"""Trigger a job to generate a switch ZTP configuration"""
ztp_stack = ",".join([item.serial_number for item in host.stack_members()])
extra_vars = [
f"ztp_host={host.name}",
f"ztp_ip={host.main_interface.ip}",
f"ztp_mac={host.main_interface.mac}",
f"ztp_model={host.model}",
f"ztp_stack='{ztp_stack}'",
]
job_template = current_app.config["AWX_ZTP_CONFIGURATION"]
current_app.logger.info(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment