Update to 2024-06-17 10:01

This commit is contained in:
Daniel Berteaud
2024-06-17 10:01:05 +02:00
parent a55c54a1c5
commit 8590b558e8
15 changed files with 80 additions and 8 deletions

View File

@@ -0,0 +1,8 @@
---
consul_cni_version: 1.5.0
consul_cni_archive_url: https://releases.hashicorp.com/consul-cni/{{ consul_cni_version }}/consul-cni_{{ consul_cni_version }}_linux_amd64.zip
consul_cni_archive_sha256: d81091300c65dd60b929e8ead15158e7a38b7f700c49141d7241e691a511f09d
# Must be the same as cni_root_dir
consul_cni_root_dir: /opt/cni

View File

@@ -0,0 +1,4 @@
---
dependencies:
- role: cni_plugins

View File

@@ -0,0 +1,7 @@
---
- name: Remove tmp and obsolete files
file: path={{ item }} state=absent
loop:
- "{{ cni_root_dir }}/tmp/consul-cni_{{ consul_cni_version }}_linux_amd64.zip"
tags: cni

View File

@@ -0,0 +1,12 @@
---
# Detect installed version (if any)
- block:
- import_tasks: ../includes/webapps_set_install_mode.yml
vars:
- root_dir: "{{ consul_cni_root_dir }}"
- version: "{{ consul_cni_version }}"
- version_file: consul_cni_version
- set_fact: consul_cni_install_mode={{ install_mode }}
- set_fact: consul_cni_current_version={{ current_version | default('') }}
tags: cni

View File

@@ -0,0 +1,19 @@
---
- when: consul_cni_install_mode != 'none'
block:
- name: Download the CNI plugins
get_url:
url: "{{ consul_cni_archive_url }}"
dest: "{{ consul_cni_root_dir }}/tmp"
checksum: sha256:{{ consul_cni_archive_sha256 }}
- name: Extract archive
unarchive:
src: "{{ consul_cni_root_dir }}/tmp/consul-cni_{{ consul_cni_version }}_linux_amd64.zip"
dest: "{{ consul_cni_root_dir }}/bin/"
include: ["consul-cni"]
remote_src: true
tags: cni

View File

@@ -0,0 +1,14 @@
---
- include_tasks: facts.yml
tags: always
- include_tasks: install.yml
tags: always
- include_tasks: write_version.yml
tags: always
- include_tasks: cleanup.yml
tags: always

View File

@@ -0,0 +1,5 @@
---
- name: Write installed version
copy: content={{ consul_cni_version }} dest={{ consul_cni_root_dir }}/meta/consul_cni_version
tags: cni