Updates to fix testing
- Don't use tmp, instead put in an /opt/devtools which is optionally
removed
- Idempotency fixes
- version bumps
Change-Id: Ica3d2371809692bc09780027f0bee49025ac1bee
diff --git a/tasks/main.yml b/tasks/main.yml
index f4fe901..46a2d7a 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -10,35 +10,43 @@
- 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: /tmp/repo.b64
+ dest: "{{ devtools_dist_dir }}/repo.b64"
- name: Decode, fix shebang, and make repo launcher executable
shell:
cmd: |
- base64 --decode /tmp/repo.b64 > /tmp/repo
+ 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"' /tmp/repo
- cp /tmp/repo /usr/local/bin/repo
+ 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
-# 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
+
+# cleanup
+- name: Delete devtools dist dir
+ when: devtools_delete_dist
+ file:
+ path: "{{ devtools_dist_dir }}"
+ state: absent