Latest update to get_url forces absolute dest url

12 views
Skip to first unread message

David Binney

unread,
Oct 19, 2016, 11:07:24 AM10/19/16
to Ansible Project
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

David Binney

unread,
Jan 4, 2017, 5:59:57 PM1/4/17
to Ansible Project
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 }}"
Reply all
Reply to author
Forward
0 new messages