From 6f3a7c2baed247ceb9a16307bd7256d47a4ce8ac Mon Sep 17 00:00:00 2001 From: Mathieu Bultel Date: Tue, 3 Apr 2018 15:43:29 +0200 Subject: [PATCH] Pass the execution id to AnsibleAction In order to read the queue with the websocket the execution id should be not None Manual cherry pick (Cherry-pick from: ef286afe5a2783c33c280507558474b23bce83dc) Change-Id: I244e4676b90a891c65e1457204b7fe0f3ade261f --- tripleo_common/actions/ansible.py | 4 ++-- workbooks/package_update.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tripleo_common/actions/ansible.py b/tripleo_common/actions/ansible.py index 8923b200c..28dfd9ed7 100644 --- a/tripleo_common/actions/ansible.py +++ b/tripleo_common/actions/ansible.py @@ -252,7 +252,7 @@ class AnsiblePlaybookAction(base.TripleOAction): self.extra_env_variables = self._kwargs_for_run.pop( 'extra_env_variables', None) self.queue_name = self._kwargs_for_run.pop('queue_name', None) - + self.execution_id = self._kwargs_for_run.pop('execution_id', None) self._work_dir = None @property @@ -342,7 +342,7 @@ class AnsiblePlaybookAction(base.TripleOAction): 'payload': { 'message': ''.join(lines), 'status': 'RUNNING', - 'execution': {'id': None}}}} + 'execution': {'id': self.execution_id}}}} def run(self, context): if 0 < self.verbosity < 6: diff --git a/workbooks/package_update.yaml b/workbooks/package_update.yaml index 39caff4e6..6bf5f791a 100644 --- a/workbooks/package_update.yaml +++ b/workbooks/package_update.yaml @@ -148,6 +148,7 @@ workflows: limit_hosts: <% $.nodes %> module_path: <% $.module_path %> queue_name: <% $.ansible_queue_name %> + execution_id: <% execution().id %> on-success: - node_update_passed: <% task().result.returncode = 0 %> - node_update_failed: <% task().result.returncode != 0 %>