Skip to content

Commit

Permalink
feat: install kustomize using asdf
Browse files Browse the repository at this point in the history
References #350
  • Loading branch information
smoyer64 committed Sep 10, 2022
1 parent eb98e90 commit e952209
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 19 deletions.
5 changes: 5 additions & 0 deletions roles/asdf/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@
- "asdf"

# TODO: figure out how to make this pretty by adding a newline

- include_tasks: tools.yml
loop: "{{ versions }}"
tags:
- asdf
25 changes: 25 additions & 0 deletions roles/asdf/tasks/tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
#

- name: add the {{ item.name }} asdf plugin
shell: asdf plugin add {{ item.name }}
register: plugin_add_result
changed_when: "plugin_add_result.rc == 0"
failed_when: "plugin_add_result.rc == 1"
tags:
- asdf

- name: install {{ item.name }} with version {{ item.version }}
shell: asdf install {{ item.name }} {{ item.version }}
register: tool_version_installed_result
changed_when: "'Downloading' in tool_version_installed_result.stdout"
tags:
- asdf

- name: set the {{ item.name }} global version to {{ item.version }}
shell: asdf global {{ item.name }} {{ item.version }}
register: plugin_global_version_set_result
changed_when: "tool_version_installed_result is changed"
failed_when: "plugin_global_version_set_result.rc > 0"
tags:
- asdf
5 changes: 5 additions & 0 deletions roles/asdf/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
#

versions:
- { name: "kustomize", version: "{{ kustomize_version }}"}
27 changes: 10 additions & 17 deletions roles/containerization/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -858,25 +858,18 @@
- kubernetes
- skaffold

- name: install kustomize
- name: remove kustomize installed to /opt
block:
- include_vars:
file: kustomize.yml
- find:
paths: /opt
file_type: any
patterns: "^kustomize-.*"
use_regex: true
register: directories_to_delete
- file:
path: /opt/kustomize-{{ kustomize_version }}
state: directory
- unarchive:
remote_src: true
src: "{{ kustomize_url }}"
dest: /opt/kustomize-{{ kustomize_version }}
- file:
src: /opt/kustomize-{{ kustomize_version }}
dest: /opt/kustomize-latest
state: link
- file:
src: /opt/kustomize-latest/kustomize
dest: /usr/bin/kustomize
state: link
path: "{{ item.path }}"
state: absent
with_items: "{{ directories_to_delete.files }}"
tags:
- containerization
- kubernetes
Expand Down
4 changes: 2 additions & 2 deletions versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ studio_version: 2.0.0
studio_build: 20210717-M17

#asdf managed tool versions
asdf_version: "v0.10.2"
asdf_version: v0.10.2
kustomize_version: latest

#BurpSuite
burp_version: latest
Expand All @@ -35,7 +36,6 @@ stern_checksum: "sha256:18bb5afa0426d1ca2e975bee2a04037378d99ffdda6e3383a575ad28
fluxctl_version: "1.25.4"
skaffold_version: "1.39.2"
skaffold_checksum: "sha256:6ecdda952ce8e917dde9a362859952dd1d3ad8ae44b2c56696ec6a89c5d8ce4d"
kustomize_version: 4.5.7
lens_version: 5.5.4-latest.20220609.2

#Development
Expand Down
1 change: 1 addition & 0 deletions workstation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@
- versions.yml
roles:
- local
- asdf

0 comments on commit e952209

Please sign in to comment.