-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate file for cilium client install
- Loading branch information
Michael McCulloch
committed
Jan 12, 2024
1 parent
b7c414d
commit 002506d
Showing
3 changed files
with
58 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
- name: Check if Cilium CLI has already been Installed. | ||
stat: | ||
path: /usr/local/bin/cilium | ||
register: cilium_init_stat | ||
when: | ||
- kubernetes_pod_network.cni == 'cilium' | ||
|
||
- name: Install Cilium CLI | ||
when: | ||
- kubernetes_pod_network.cni == 'cilium' | ||
- not cilium_init_stat.stat.exists | ||
block: | ||
- name: Get Cilium CLI version | ||
shell: curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt | ||
register: cilium_cli_version | ||
changed_when: false | ||
|
||
- name: Set CLI architecture | ||
set_fact: | ||
cli_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" | ||
|
||
- name: Download Cilium CLI | ||
get_url: | ||
url: "https://github.com/cilium/cilium-cli/releases/download/{{ cilium_cli_version.stdout }}/cilium-linux-{{ cli_arch }}.tar.gz" | ||
dest: "/tmp/cilium-linux-{{ cli_arch }}.tar.gz" | ||
mode: '0644' | ||
|
||
- name: Download Cilium CLI checksum | ||
get_url: | ||
url: "https://github.com/cilium/cilium-cli/releases/download/{{ cilium_cli_version.stdout }}/cilium-linux-{{ cli_arch }}.tar.gz.sha256sum" | ||
dest: "/tmp/cilium-linux-{{ cli_arch }}.tar.gz.sha256sum" | ||
mode: '0644' | ||
|
||
- name: Verify Cilium CLI checksum | ||
shell: sha256sum --check /tmp/cilium-linux-{{ cli_arch }}.tar.gz.sha256sum | ||
args: | ||
chdir: /tmp | ||
|
||
- name: Extract Cilium CLI | ||
unarchive: | ||
src: "/tmp/cilium-linux-{{ cli_arch }}.tar.gz" | ||
dest: /usr/local/bin | ||
remote_src: true | ||
|
||
- name: Remove downloaded files | ||
file: | ||
path: "/tmp/cilium-linux-{{ cli_arch }}.tar.gz{{ item }}" | ||
state: absent | ||
loop: | ||
- '' | ||
- '.sha256sum' | ||
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