Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
Read a text file over https address into variable
34 views
Skip to first unread message
Homayoun Najafizadeh
unread,
Jul 19, 2017, 7:05:41 PM
7/19/17
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
Hi All,
Is there anyway I can download this path via Ansible?
curl -LO
https://storage.googleapis.com/kubernetes-release/release/$(curl
-s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
As you can see the path is variable based on value in stable.txt file (at this point is '1.7.1').
Thanks
Dick Visser
unread,
Jul 20, 2017, 1:58:10 AM
7/20/17
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...@googlegroups.com
- name: Test playbook
hosts: localhost
gather_facts: false
become: false
tasks:
- uri:
url:
https://storage.googleapis.com/kubernetes-release/release/stable.txt
return_content: yes
register: response
- set_fact:
version: "{{ response.content | trim }}"
- debug: var=version
> --
> 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
ansible-proje...@googlegroups.com
.
> To post to this group, send email to
ansible...@googlegroups.com
.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/6dafaf98-1d1d-46d8-9272-f84691d36fca%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout
.
--
Dick Visser
Sr. System & Network Engineer
GÉANT
Want to join us? We're hiring:
https://www.geant.org/jobs
Brian Coca
unread,
Jul 20, 2017, 10:22:12 AM
7/20/17
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
Or if you don't need any of the 'advanced' features of the uri module"
- set_fact:
version:"'{{lookup('url',
'
https://storage.googleapis.com/kubernetes-release/release/stable.txt
,
split_lilnes=False')}}"
---------------
Brian Coca
Reply all
Reply to author
Forward
0 new messages