diff --git a/tasks/main.yml b/tasks/main.yml index 4d7c2a8..e5fc705 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,7 +3,7 @@ - name: Execute pre-commands command: '{{ item.pre_command.command }}' args: - chdir: '{{ item.pre_command.chdir | default(omit) }}' + chdir: '{{ item.pre_command.chdir | default(item.dest) }}' with_items: '{{ git_checkouts }}' when: '{{ item.pre_command is defined }}' @@ -19,7 +19,7 @@ - name: Execute post-commands command: '{{ item.post_command.command }}' args: - chdir: '{{ item.post_command.chdir | default(omit) }}' + chdir: '{{ item.post_command.chdir | default(item.dest) }}' with_items: '{{ git_checkouts }}' when: '{{ item.post_command is defined }}'