On 19.07.2018 01:35, Brian Peavey wrote:
> Hi,
> I'm trying to download and install Segger JLink tools in an Ubuntu
> VM.
> The relevant portion of my ansible playbook is -
>
> - hosts: fw_dev
> vars:
> - username: "vagrant"
> - download_dir: "/home/{{username}}/Downloads"
> - jlink_ver: "V632h_x86_64"
> - jlink_chk: "md5:cef479d627f9889a7f5c2cb77ee14877"
You should not have the dash infront of the variables, it's not valid.
> - block:
> - name: Download SEGGER J-Link
> get_url:
> url:
> "
https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb"
> dest: "{{download_dir}}/JLink_Linux_{{jlink_ver}}.deb"
> checksum: "{{jlink_chk}}"
> - name: Install SEGGER J-Link
> become: true
> apt:
> deb: "{{download_dir}}/JLink_Linux_{{jlink_ver}}.deb"
> state: present
> rescue:
> - debug:
> msg: "SEGGER J-Link Task Failed"
>
>
> I've also tried without the checksum, but then I get a lailure on the
> install due to the package format being incorrect.
> If I use a web browser to go to the url, it takes me to another page
> asking to accept the license terms before it downloads the package.
> How do
> I handle this using Ansible?
Since you need to answer the HTML form you can't use get_url since it
doesn't support sending that data, but the uri module does.
You can try this.
- uri:
url:
https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb
method: POST
body-format: form-urlencoded
body: accept_license_agreement=accepted
dest: /tmp/JLink_Linux_x86_64.deb
--
Kai Stian Olstad