blob: 46a2d7a74eccb2b8c064dd9a3c493925cd3cf0c6 [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"
# create devtools dist dir
- name: create devtools dist dir
file:
path: "{{ devtools_dist_dir }}"
state: directory
owner: root
group: root
mode: 0755
# repo
- name: Download repo launcher
get_url:
url: "{{ devtools_repo_url }}"
checksum: "{{ devtools_repo_checksum }}"
dest: "{{ devtools_dist_dir }}/repo.b64"
- name: Decode, fix shebang, and make repo launcher executable
shell:
cmd: |
base64 --decode "{{ devtools_dist_dir }}/repo.b64" > \
"{{ devtools_dist_dir }}/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"' \
"{{ devtools_dist_dir }}/repo"
cp "{{ devtools_dist_dir }}/repo" /usr/local/bin/repo
chmod 755 /usr/local/bin/repo
creates: /usr/local/bin/repo
- name: Install additional devtools
include_tasks: "{{ dt_inst_item }}.yml"
loop: "{{ devtools_install | flatten(levels=1) }}"
loop_control:
loop_var: dt_inst_item
# cleanup
- name: Delete devtools dist dir
when: devtools_delete_dist
file:
path: "{{ devtools_dist_dir }}"
state: absent