Skip to content

Commit aa1b171

Browse files
committed
Add mode to container hotfix playbook file copies
1 parent abcd462 commit aa1b171

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

doc/source/operations/hotfix-playbook.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Playbook variables:
2929
containers. Default is an empty string.
3030

3131
* ``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.
32+
container. Consists of a list of dicts with keys ``src`` and ``dest``
33+
(required), and ``mode`` (optional - default 400). Default is an empty list.
3434

3535
* ``container_hotfix_container_regex``: Regex to match container names against.
3636
Must match the entire name e.g. "nova" or "nova*" will result in only
@@ -62,6 +62,7 @@ Example Variables file
6262
container_hotfix_files:
6363
- src: "~/quick-fix.sh"
6464
dest: "/tmp/quick-fix.sh"
65+
mode: "700"
6566
- src: "/home/stackhpc/new_nova_conf.conf"
6667
dest: "/etc/nova/nova.conf"
6768
container_hotfix_container_regex: "nova.*"

etc/kayobe/ansible/run-container-hotfix.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
loop: "{{ container_hotfix_files }}"
1010
loop_control:
1111
index_var: index
12+
13+
- name: Set mode for copied files
14+
command: "{{ kolla_container_engine | default('docker') }} exec {{ '-u 0' if container_hotfix_become else '' }} {{ hotfix_container }} chmod {{ item.mode | default('400') }} {{ item.dest }}"
15+
loop: "{{ container_hotfix_files }}"
16+
loop_control:
17+
index_var: index
18+
1219
when: container_hotfix_files != []
1320

1421
- name: Run container_hotfix_command

0 commit comments

Comments
 (0)