diff --git a/ansible/Dockerfiles/example/autoregister.yml b/ansible/Dockerfiles/example/autoregister.yml index a8077076c..29cb63241 100644 --- a/ansible/Dockerfiles/example/autoregister.yml +++ b/ansible/Dockerfiles/example/autoregister.yml @@ -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 @@ -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}}" diff --git a/ansible/Dockerfiles/example/variables.yml b/ansible/Dockerfiles/example/variables.yml index 8d1e55df9..56f43f3d0 100644 --- a/ansible/Dockerfiles/example/variables.yml +++ b/ansible/Dockerfiles/example/variables.yml @@ -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: