blob: f4fe901282882898871163a432f6fd691ef0e22a [file] [log] [blame]
---
# devtools tasks/main.yml
#
# SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org>
# SPDX-License-Identifier: Apache-2.0
- name: include OS-specific vars
include_vars: "{{ ansible_os_family }}.yml"
- name: include OS-specific tasks
include_tasks: "{{ ansible_os_family }}.yml"
# repo
- name: Download repo launcher
get_url:
url: "{{ devtools_repo_url }}"
checksum: "{{ devtools_repo_checksum }}"
dest: /tmp/repo.b64
- name: Decode, fix shebang, and make repo launcher executable
shell:
cmd: |
base64 --decode /tmp/repo.b64 > /tmp/repo
# force repo launcher to use python3 - not needed if python-is-python3 installed
sed -i.bak 's"#!/usr/bin/env python"#!/usr/bin/env python3"' /tmp/repo
cp /tmp/repo /usr/local/bin/repo
chmod 755 /usr/local/bin/repo
creates: /usr/local/bin/repo
# cleanup
- name: Clean up downloads in /tmp
file:
path: "/tmp/{{ item }}"
state: absent
with_items:
- repo.b64
- repo.bak
- repo
- name: Install additional devtools
include_tasks: "{{ dt_inst_item }}.yml"
loop: "{{ devtools_install | flatten(levels=1) }}"
loop_control:
loop_var: dt_inst_item