-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
|
||
# The K9s repo | ||
k9s_repo: https://github.com/derailed/k9s | ||
# The K9s version to download | ||
k9s_version: v0.32.5 | ||
# The OS variant and architecture to use | ||
# See https://github.com/derailed/k9s/releases for the available options | ||
k9s_os: "{{ ansible_system }}" | ||
k9s_architecture: "{{ 'amd64' if ansible_architecture == 'x86_64' else ansible_architecture }}" | ||
# The name of the K9s archive | ||
k9s_archive_name: "k9s_{{ k9s_os }}_{{ k9s_architecture }}.tar.gz" | ||
# The URL of the K9s archive to download | ||
k9s_archive_url: "{{ k9s_repo }}/releases/download/{{ k9s_version }}/{{ k9s_archive_name }}" | ||
|
||
# The directory into which the K9s archive should be unpacked | ||
k9s_unpack_directory: "/opt/k9s/{{ k9s_version }}" | ||
# The directory into which the K9s binary should be placed | ||
k9s_bin_directory: /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
|
||
- name: Ensure unpack directory exists | ||
file: | ||
path: "{{ k9s_unpack_directory }}" | ||
state: directory | ||
|
||
- name: Download and extract K9s archive | ||
unarchive: | ||
remote_src: yes | ||
src: "{{ k9s_archive_url }}" | ||
dest: "{{ k9s_unpack_directory }}" | ||
|
||
- name: Ensure binary directory exists | ||
file: | ||
path: "{{ k9s_bin_directory }}" | ||
state: directory | ||
|
||
- name: Copy executable to binary directory | ||
copy: | ||
remote_src: yes | ||
src: "{{ (k9s_unpack_directory, 'k9s') | path_join }}" | ||
dest: "{{ k9s_bin_directory }}" | ||
mode: u=rwx,g=rw,o=rx | ||
|
||
- name: Ensure K9s shell completions are in .bashrc | ||
lineinfile: | ||
path: "{{ ansible_env.HOME }}/.bashrc" | ||
line: source <(k9s completion bash) |