Skip to content

Commit ef7de49

Browse files
Alex-WelshMoteHue
authored andcommitted
Add documentation for container hotfix playbook
1 parent be83b8e commit ef7de49

File tree

3 files changed

+72
-49
lines changed

3 files changed

+72
-49
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
===============
2+
Hotfix Playbook
3+
===============
4+
5+
Using the Container Hotfix Playbook
6+
===================================
7+
8+
The StackHPC Kayobe configuration contains a playbook called
9+
``hotfix-containers.yml`` which can be used to execute commands on, and copy
10+
files into, a given set of containers.
11+
12+
This playbook will first copy across any hotfix files, and then run the
13+
hotfix command. If either of these are not specified, the corresponding step
14+
will be skipped.
15+
16+
This playbook is designed for use in high-severity hotfixes ONLY and should not
17+
be used for regular operations.
18+
19+
The playbook can be invoked with:
20+
21+
.. code-block:: console
22+
23+
kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/hotfix-containers.yml
24+
25+
Playbook variables:
26+
-------------------
27+
28+
* ``container_hotfix_command``: A command to run on each of the target
29+
containers. Default is an empty string.
30+
31+
* ``container_hotfix_files``: A list of files to copy into each target
32+
container. Consists of a list of dicts with keys ``src`` and ``dest``.
33+
Default is an empty list.
34+
35+
* ``container_hotfix_container_regex``: Regex to match container names against.
36+
Must match the entire name e.g. "nova" or "nova*" will result in only
37+
matching a single container called "nova". To properly match every container
38+
starting with "nova", the regex must be "nova.*" Default is an empty string.
39+
40+
* ``container_hotfix_restart_containers``: Whether to restart containers after
41+
applying the hotfix. Default is False.
42+
43+
* ``container_hotfix_become``: Create files and exec as root in the target
44+
containers. Default is False.
45+
46+
47+
It is strongly recommended that you write your container_hotfix_* variables
48+
to a file, then add them as an extra var. e.g:
49+
50+
.. code-block:: console
51+
52+
kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/hotfix-containers.yml -e "@~/vars.yml"
53+
54+
55+
Example Variables file
56+
----------------------
57+
58+
.. code-block:: yaml
59+
60+
---
61+
container_hotfix_command: "/tmp/quick-fix.sh"
62+
container_hotfix_files:
63+
- src: "~/quick-fix.sh"
64+
dest: "/tmp/quick-fix.sh"
65+
- src: "/home/stackhpc/new_nova_conf.conf"
66+
dest: "/etc/nova/nova.conf"
67+
container_hotfix_container_regex: "nova.*"
68+
container_hotfix_restart_containers: True
69+
container_hotfix_become: True

doc/source/operations/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ This guide is for operators of the StackHPC Kayobe configuration project.
99

1010
rabbitmq
1111
octavia
12+
hotfix-containers

etc/kayobe/ansible/hotfix-containers.yml

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,8 @@
33
# If you're considering using this for regular operations, please consider
44
# developing a more suitable solution instead.
55
#
6-
# This playbook will first copy across any hotfix files, and then run the
7-
# hotfix command. If either of these are not specified, the corresponding step
8-
# will be skipped.
9-
#
10-
# It is strongly recommended that you write your container_hotfix_* variables
11-
# to a file, then add them as an extra var. e.g:
12-
# kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/hotfix-containers.yml -e "@~/vars.yml"
13-
14-
# Vars:
15-
# container_hotfix_command
16-
# Type: string
17-
# Desc: Command to run in a set of containers
18-
# Default: ""
19-
#
20-
# container_hotfix_files
21-
# Type: list of dict containing src,dest
22-
# Desc: Files to copy into the destination containers
23-
# Default: []
24-
#
25-
# container_hotfix_container_regex
26-
# Type: string
27-
# Desc: Regex to match container names against. Must match the entire name
28-
# e.g. "nova" or "nova*" will result in only matching a single
29-
# container called "nova". To properly match every container
30-
# starting with "nova", the regex must be "nova.*"
31-
# Default: ""
32-
#
33-
# container_hotfix_restart_containers
34-
# Type: bool
35-
# Desc: Whether to restart containers after applying the hotfix
36-
# Default: False
37-
#
38-
# container_hotfix_become
39-
# Type: bool
40-
# Desc: Create files and exec as root in the destination container(s)
41-
# Default: False
42-
43-
# Example vars.yml:
44-
# ---
45-
# container_hotfix_command: "/tmp/quick-fix.sh"
46-
# container_hotfix_files:
47-
# - src: "~/quick-fix.sh"
48-
# dest: "/tmp/quick-fix.sh"
49-
# - src: "/home/stackhpc/new_nova_conf.conf"
50-
# dest: "/etc/nova/nova.conf"
51-
# container_hotfix_container_regex: "nova.*"
52-
# container_hotfix_restart_containers: True
53-
# container_hotfix_become: True
54-
6+
# See https://stackhpc-kayobe-config.readthedocs.io/en/stackhpc-yoga/operations/hotfix-containers.html
7+
# for more information.
558

569
- name: Hotfix containers
5710
hosts: overcloud

0 commit comments

Comments
 (0)