Initial devtools commit
Change-Id: Ia7b7afa7c5b310edfdb612c77fae49830a7bf5e7
diff --git a/tasks/main.yml b/tasks/main.yml
new file mode 100644
index 0000000..f4fe901
--- /dev/null
+++ b/tasks/main.yml
@@ -0,0 +1,44 @@
+---
+# 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