Looks like i have make a work around myself. This will just grab the 
directory one level above the source script location. 

    - name: Get build path
      shell: echo $(dirname `pwd`)
      register: build_path

    - debug: msg="Using build path  {{ build_path.stdout }}"


On Thursday, 20 October 2016 01:07:24 UTC+10, David Binney wrote:
>
> Hey guys, 
>
> The latest changes to get_url has forced the dest path to be absolute. 
> Previously, this was relative, which was simple to maintain, but this 
> change seems to add some complications. Basically, the previous version was 
> just pulling into the relative "src" directory, but now I will have to 
> somehow get the full path. I have tried a few things, but it does not seem 
> to be working very well, considering the playbook is in under a different 
> path. 
>
> playbook = /var/lib/go-agent/pipelines/feeds-uat/ansible/composer.yaml
> pwd         = /var/lib/go-agent/pipelines/feeds-uat/ansible
>
> where i want the file to end up
>   *  /var/lib/go-agent/pipelines/feeds-uat/src
> Things I cannot do
>   *  hardcode the path
>
> Before the change, this was as simple as having dest=src, but now ...... 
>
>
> ~  22     - name: testing
> ~  23       command: "echo ${PWD%}" ## this is trying to get one level 
> higher.. does not work
> +  24       register: src_path
>
> ~  29 #    - name: Pull down composer file
> +  30 #      get_url: url=https://getcomposer.org/composer.phar 
> dest='{{src_path.stdout}}/src' mode=0755
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/909abf28-f9df-4f70-8e8d-2dcb101616fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to