Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
Can url path in get_url be build dynamically?
25 views
Skip to first unread message
Kenneth Wong
unread,
Aug 2, 2019, 10:16:54 AM
8/2/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
The following playbook will failed but exchanged with commented out line then it would work.
Is there a way to evaluate the url string in get_url?
---
- hosts: all
become: true
tasks:
- name: install docker-compose
get_url:
# url:
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-x86_64
url:
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname
-s`-`uname -m`
dest: /usr/local/bin/docker-compose
mode: '0744'
owner: vagrant
group: vagrant
======
TASK [install docker-compose] **************************************************
fatal: [default]: FAILED! => {"changed": false, "dest": "/usr/local/bin/docker-compose", "elapsed": 0, "msg": "Request failed", "response": "HTTP Error 400: Bad Request", "status_code": 400, "url": "
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname
-s`-`uname -m`"}
Joacim Mårtensson
unread,
Aug 3, 2019, 6:24:07 AM
8/3/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Try using Ansible facts instead
url:
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-{{
ansible_system }}-{{ ansible_architecture }}
Kenneth Wong
unread,
Aug 3, 2019, 2:32:31 PM
8/3/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
That worked great. Thank you.
Reply all
Reply to author
Forward
0 new messages