From 16de74536e0846ba1d2e5101618df9146c785a41 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 22 Apr 2015 15:39:53 +0100 Subject: Stop using regex_replace in 'creates' arguments. Use the dict-form for the creates arguments, to avoid problems with strings interpolations. This solved problems on a Trove with TROVE_ID 'baserock-clone', because it wasn't recognising the already exsisting repositories. Change-Id: Ic613f732596aae9d81b0c17c8fd1e846d69f58db --- ansible/roles/trove-setup/tasks/lorry-controller-setup.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ansible/roles/trove-setup/tasks/lorry-controller-setup.yml') diff --git a/ansible/roles/trove-setup/tasks/lorry-controller-setup.yml b/ansible/roles/trove-setup/tasks/lorry-controller-setup.yml index f839ca8..4b1b177 100644 --- a/ansible/roles/trove-setup/tasks/lorry-controller-setup.yml +++ b/ansible/roles/trove-setup/tasks/lorry-controller-setup.yml @@ -5,7 +5,8 @@ - name: Create the TROVE_ID/local-config/lorries repository shell: | su git -c 'ssh localhost create '{{ TROVE_ID|quote|quote|quote }}'/local-config/lorries' - creates=/home/git/repos/{{ TROVE_ID|regex_replace('(\\W)', '\\\\\\1')}}/local-config/lorries.git + args: + creates: /home/git/repos/{{ TROVE_ID }}/local-config/lorries.git - name: Create a temporary folder to copy templates shell: su git -c 'mktemp -d' register: lorry_controller_templates @@ -47,7 +48,8 @@ su git -c 'cp /usr/share/trove-setup/closed-source-lorries/README '{{ lorry_controller_repository.stdout|quote|quote }}'/lorries/closed-source-lorries/README' su git -c 'cd '{{ lorry_controller_repository.stdout|quote|quote }}'/lorries; git add README lorry-controller.conf open-source-lorries/README closed-source-lorries/README; git commit -m "Initial configuration"; git push origin master' su git -c 'rm -rf '{{ lorry_controller_repository.stdout|quote|quote }} - creates=/home/git/repos/{{ TROVE_ID|regex_replace('(\\W)', '\\\\\\1')}}/local-config/lorries.git/refs/heads/master + args: + creates: /home/git/repos/{{ TROVE_ID }}/local-config/lorries.git/refs/heads/master # Migration: Remove the old lorry-controller cronjob if exists - name: Look for lorry-controller old cronjob (This task can fail) -- cgit v1.2.1