Zack Williams | 04575aa | 2022-03-19 21:51:44 -0700 | [diff] [blame^] | 1 | --- |
| 2 | # devtools tasks/main.yml |
| 3 | # |
| 4 | # SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org> |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | |
| 7 | - name: include OS-specific vars |
| 8 | include_vars: "{{ ansible_os_family }}.yml" |
| 9 | |
| 10 | - name: include OS-specific tasks |
| 11 | include_tasks: "{{ ansible_os_family }}.yml" |
| 12 | |
| 13 | # repo |
| 14 | - name: Download repo launcher |
| 15 | get_url: |
| 16 | url: "{{ devtools_repo_url }}" |
| 17 | checksum: "{{ devtools_repo_checksum }}" |
| 18 | dest: /tmp/repo.b64 |
| 19 | |
| 20 | - name: Decode, fix shebang, and make repo launcher executable |
| 21 | shell: |
| 22 | cmd: | |
| 23 | base64 --decode /tmp/repo.b64 > /tmp/repo |
| 24 | # force repo launcher to use python3 - not needed if python-is-python3 installed |
| 25 | sed -i.bak 's"#!/usr/bin/env python"#!/usr/bin/env python3"' /tmp/repo |
| 26 | cp /tmp/repo /usr/local/bin/repo |
| 27 | chmod 755 /usr/local/bin/repo |
| 28 | creates: /usr/local/bin/repo |
| 29 | |
| 30 | # cleanup |
| 31 | - name: Clean up downloads in /tmp |
| 32 | file: |
| 33 | path: "/tmp/{{ item }}" |
| 34 | state: absent |
| 35 | with_items: |
| 36 | - repo.b64 |
| 37 | - repo.bak |
| 38 | - repo |
| 39 | |
| 40 | - name: Install additional devtools |
| 41 | include_tasks: "{{ dt_inst_item }}.yml" |
| 42 | loop: "{{ devtools_install | flatten(levels=1) }}" |
| 43 | loop_control: |
| 44 | loop_var: dt_inst_item |