Skip to content

Commit

Permalink
adding hauler store
Browse files Browse the repository at this point in the history
  • Loading branch information
MozeBaltyk committed May 14, 2024
1 parent e51c184 commit 34e4d18
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions roles/build_airgap_hauler/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# defaults file for build_airgap_hauler
hauler_version: "1.0.3"
directory_package: "{{ global_directory_package_build }}"
tar_zst_name: "{{ global_package_name }}"
path_to_package_zst: "{{ global_path_to_package_zst }}"
Expand Down
21 changes: 14 additions & 7 deletions roles/build_airgap_hauler/tasks/hauler.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
---
- name: Append lists together
ansible.builtin.set_fact:
list_images: "{{ list_images_rke2 + list_images_longhorn | default([]) + list_images_certmanager | default([]) + list_images_rancher_latest | default([]) + list_images_neuvector | default([]) + list_images_kubevip | default([]) }}"
list_images: "{{ list_images_longhorn | default([]) + list_images_certmanager | default([]) + list_images_rancher_latest | default([]) + list_images_neuvector | default([]) + list_images_kubevip | default([]) }}"
#list_images: "{{ list_images_rke2 + list_images_longhorn | default([]) + list_images_certmanager | default([]) + list_images_rancher_latest | default([]) + list_images_neuvector | default([]) + list_images_kubevip | default([]) }}"

- name: Install Hauler if not present
ansible.builtin.shell:
cmd: |
set -o pipefail
command -v hauler || curl -sfL https://get.hauler.dev | bash
curl -sfL https://get.hauler.dev | HAULER_VERSION={{ hauler_version }} bash
executable: /bin/bash
changed_when: false

- name: Copy the hauler binary to package
ansible.builtin.copy:
src: /usr/local/bin/hauler
- name: Download and Unarchive hauler archive from URL
ansible.builtin.unarchive:
src: "https://github.com/rancherfederal/hauler/releases/download/v{{ hauler_version }}/hauler_{{ hauler_version }}_linux_amd64.tar.gz"
dest: "{{ directory_package }}"
mode: '0750'
remote_src: true
become: true

- name: Clean up files
ansible.builtin.file:
path: "{{ directory_package }}/{{ item }}"
state: absent
loop:
- "LICENSE"
- "README.md"

- name: Push template
ansible.builtin.template:
Expand Down
2 changes: 2 additions & 0 deletions roles/build_airgap_hauler/templates/airgap_hauler.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if list_images|length > 0 %}
# images
apiVersion: content.hauler.cattle.io/v1alpha1
kind: Images
Expand All @@ -10,6 +11,7 @@ spec:
{% for item in list_images %}
- name: {{ item }}
{% endfor %}
{% endif %}
{% if rancher_wanted or longhorn_wanted or neuvector_wanted %}
# Helm Charts
---
Expand Down

0 comments on commit 34e4d18

Please sign in to comment.