diff --git a/releasenotes/notes/update-params-workflow-b26fd4cc40549537.yaml b/releasenotes/notes/update-params-workflow-b26fd4cc40549537.yaml new file mode 100644 index 000000000..4c0210154 --- /dev/null +++ b/releasenotes/notes/update-params-workflow-b26fd4cc40549537.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds a workflow to update the parameters in a given deployment plan so the + tripleo.parameters.update action does not need to be called directly. \ No newline at end of file diff --git a/tripleo_common/actions/parameters.py b/tripleo_common/actions/parameters.py index 1f3ca3a3e..49da158a3 100644 --- a/tripleo_common/actions/parameters.py +++ b/tripleo_common/actions/parameters.py @@ -27,7 +27,7 @@ from tripleo_common.actions import templates from tripleo_common import constants from tripleo_common import exception from tripleo_common.utils import nodes -from tripleo_common.utils import parameters +from tripleo_common.utils import parameters as parameter_utils from tripleo_common.utils import passwords as password_utils from tripleo_common.utils import plan as plan_utils @@ -223,7 +223,7 @@ class UpdateRoleParametersAction(UpdateParametersAction): def run(self, context): baremetal_client = self.get_baremetal_client(context) compute_client = self.get_compute_client(context) - self.parameters = parameters.set_count_and_flavor_params( + self.parameters = parameter_utils.set_count_and_flavor_params( self.role, baremetal_client, compute_client) return super(UpdateRoleParametersAction, self).run(context) @@ -508,8 +508,8 @@ class GetProfileOfFlavorAction(base.TripleOAction): def run(self, context): compute_client = self.get_compute_client(context) try: - return parameters.get_profile_of_flavor(self.flavor_name, - compute_client) + return parameter_utils.get_profile_of_flavor(self.flavor_name, + compute_client) except exception.DeriveParamsError as err: LOG.error('Derive Params Error: %s', err) return actions.Result(error=str(err)) diff --git a/workbooks/plan_management.yaml b/workbooks/plan_management.yaml index c0823aeb8..47d6e4458 100644 --- a/workbooks/plan_management.yaml +++ b/workbooks/plan_management.yaml @@ -591,6 +591,48 @@ workflows: on-success: - fail: <% $.get('status') = "FAILED" %> + update_parameters: + description: > + Updates plan environment with parameters. + + tags: + - tripleo-common-managed + + input: + - container: overcloud + - parameters + - key + - queue_name: tripleo + + tasks: + update_parameters: + action: tripleo.parameters.update + input: + container: <% $.container %> + parameters: <% $.parameters %> + key: <% $.key %> + on-complete: notify_zaqar + publish-on-error: + status: FAILED + message: <% task().result %> + publish: + status: SUCCESS + message: <% task().result %> + + notify_zaqar: + action: zaqar.queue_post + input: + queue_name: <% $.queue_name %> + messages: + body: + type: tripleo.plan_management.v1.update_parameters + payload: + status: <% $.status %> + message: <% $.get('message', '') %> + execution: <% execution() %> + on-success: + - fail: <% $.get('status') = "FAILED" %> + publish_ui_logs_to_swift: description: > This workflow drains a zaqar queue, and publish its messages into a log