Skip to content

Commit

Permalink
Merge pull request #1326 from proditis/master
Browse files Browse the repository at this point in the history
introduce exec_before_replace flag for cases where we want the exec commands before the replace operations
  • Loading branch information
proditis authored Nov 27, 2024
2 parents 1ab2ac6 + 9532aec commit 68bed50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ansible/Dockerfiles/example/autoregister.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
replace: 'ETSCTF_{{item.code}}'
backup: no

- name: BUILD_COMMANDS.exec
become_user: "{{item.become|default('root')}}"
become: true
when: BUILD_COMMANDS is defined and BUILD_COMMANDS.exec is defined and EXEC_BEFORE_REPLACE is defined
with_items: "{{BUILD_COMMANDS.exec}}"
raw: "{{item.cmd}}"


- name: BUILD_COMMANDS.replace
when: BUILD_COMMANDS is defined and BUILD_COMMANDS.replace is defined
Expand All @@ -71,7 +78,7 @@
- name: BUILD_COMMANDS.exec
become_user: "{{item.become|default('root')}}"
become: true
when: BUILD_COMMANDS is defined and BUILD_COMMANDS.exec is defined
when: BUILD_COMMANDS is defined and BUILD_COMMANDS.exec is defined and EXEC_BEFORE_REPLACE is not defined
with_items: "{{BUILD_COMMANDS.exec}}"
raw: "{{item.cmd}}"

Expand Down
2 changes: 2 additions & 0 deletions ansible/Dockerfiles/example/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ ETSCTF_TREASURES:
#INI_FILES:
# - { file: "/path/to/file.ini", section: "SECTION", option: OPTION, value: "VALUE"}

# Uncoment the following to run exec before replace
# EXEC_BEFORE_REPLACE: true
# These commands are executed at build time by ansible
BUILD_COMMANDS:
# exec:
Expand Down

0 comments on commit 68bed50

Please sign in to comment.