Skip to content

Commit

Permalink
Make AT workflow timeout configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mshriver authored and JacobCallahan committed Aug 7, 2020
1 parent b9722e6 commit fa87ea3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion broker/providers/ansible_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
PWORD = settings.ANSIBLETOWER.password
RELEASE_WORKFLOW = settings.ANSIBLETOWER.release_workflow
EXTEND_WORKFLOW = settings.ANSIBLETOWER.extend_workflow
AT_TIMEOUT = settings.ANSIBLETOWER.workflow_timeout


class AnsibleTower(Provider):
Expand Down Expand Up @@ -171,7 +172,7 @@ def exec_workflow(self, **kwargs):
)
job = wfjt.launch(payload={"extra_vars": str(kwargs).replace("--", "")})
logger.info(f"Waiting for job: {AT_URL}{job.url}".replace("//", "/"))
job.wait_until_completed(timeout=1800)
job.wait_until_completed(timeout=AT_TIMEOUT)
if not job.status == "successful":
logger.error(
f"Workflow Status: {job.status}\nExplanation: {job.job_explanation}"
Expand Down
3 changes: 2 additions & 1 deletion broker_settings.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ AnsibleTower:
password: "<plain text password>"
release_workflow: "remove-vm"
extend_workflow: "extend-vm"
workflow_timeout: 3600
TestProvider:
config_value: "something"
# You can set a nickname as a shortcut for arguments
Expand All @@ -24,4 +25,4 @@ nicks:
test_action: "fake"
arg1: "abc"
arg2: 123
arg3: True
arg3: True

0 comments on commit fa87ea3

Please sign in to comment.