|
| 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 |
0 commit comments