tripleo-common/workbooks/fernet-key-rotate.yaml
Brad P. Crochet 86050e642d Fix message type payload in rotate_fernet_keys workflow
The rotate_fernet_keys workflow had a copy/paste error. It was using the
wrong message type in the zaqar message. This sets it to the correct type.
The patch also includes streamlining of the messaging, to follow a better
pattern.

Change-Id: I5ddf433f39a530afe40fe13e551a91577949f9f2
Closes-Bug: #1747945
2018-02-07 11:03:38 -05:00

81 lines
2.3 KiB
YAML

---
version: '2.0'
name: tripleo.fernet_keys.v1
description: TripleO fernet key rotation workflows
workflows:
rotate_fernet_keys:
input:
- container
- queue_name: tripleo
- ansible_extra_env_variables:
ANSIBLE_HOST_KEY_CHECKING: 'False'
tags:
- tripleo-common-managed
tasks:
rotate_keys:
action: tripleo.parameters.rotate_fernet_keys container=<% $.container %>
on-success: deploy_ssh_key
on-error: notify_zaqar
publish-on-error:
status: FAILED
message: <% task().result %>
deploy_ssh_key:
workflow: tripleo.validations.v1.copy_ssh_key
on-success: get_privkey
on-error: notify_zaqar
publish-on-error:
status: FAILED
message: <% task().result %>
get_privkey:
action: tripleo.validations.get_privkey
on-success: deploy_keys
on-error: notify_zaqar
publish-on-error:
status: FAILED
message: <% task().result %>
deploy_keys:
action: tripleo.ansible-playbook
input:
hosts: keystone
inventory: /usr/bin/tripleo-ansible-inventory
ssh_private_key: <% task(get_privkey).result %>
extra_env_variables: <% $.ansible_extra_env_variables + dict(TRIPLEO_PLAN_NAME=>$.container) %>
verbosity: 0
remote_user: heat-admin
become: true
extra_vars:
fernet_keys: <% task(rotate_keys).result %>
use_openstack_credentials: true
playbook: /usr/share/tripleo-common/playbooks/rotate-keys.yaml
on-success: notify_zaqar
publish:
status: SUCCESS
message: <% task().result %>
on-error: notify_zaqar
publish-on-error:
status: FAILED
message: <% task().result %>
notify_zaqar:
action: zaqar.queue_post
input:
queue_name: <% $.queue_name %>
messages:
body:
type: tripleo.fernet_keys.v1.rotate_fernet_keys
payload:
status: <% $.status %>
message: <% $.get('message', '') %>
execution: <% execution() %>
on-success:
- fail: <% $.get('status') = "FAILED" %>