From 8e75925b52805b0770ba40ebf5fb8e8f5f9de2d4 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Wed, 27 Jul 2022 13:33:04 +0200 Subject: [PATCH] Rebase dependency;Comment out redundant logic --- ansible/roles/appliance/tasks/dependencies.yml | 2 ++ .../ansible_payload/roles/metacluster/tasks/main.yml | 9 ++++----- ansible/roles/metacluster/tasks/components.yml | 3 ++- ansible/vars/metacluster.yml | 11 ++++++++--- packer/k8sbootstrap.pkr.hcl | 4 +++- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ansible/roles/appliance/tasks/dependencies.yml b/ansible/roles/appliance/tasks/dependencies.yml index 2d9f04f..18b9702 100644 --- a/ansible/roles/appliance/tasks/dependencies.yml +++ b/ansible/roles/appliance/tasks/dependencies.yml @@ -8,6 +8,8 @@ - name: Download & install static binaries ansible.builtin.get_url: url: "{{ item.url }}" + url_username: "{{ item.username | default(omit) }}" + url_password: "{{ item.password | default(omit) }}" dest: /usr/local/bin/{{ item.filename }} owner: root group: root diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml index 4ec6557..73a994d 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml @@ -121,15 +121,14 @@ ansible.builtin.shell: cmd: >- skopeo copy \ + --insecure-policy \ --dest-tls-verify=false \ --dest-creds admin:{{ vapp['guestinfo.rootpw'] }} \ docker-archive:./{{ item }} \ docker://registry.{{ vapp['metacluster.fqdn'] }}/library/$( \ - k3s ctr run \ - --rm \ - --mount type=bind,src=$PWD,dst=/data,options=rbind:ro \ - quay.io/skopeo/stable:v1.8.0 skopeo \ - skopeo list-tags docker-archive:/data/{{ item }} | \ + skopeo list-tags \ + --insecure-policy \ + docker-archive:./{{ item }} | \ jq -r '.Tags[0]') chdir: /opt/metacluster/container-images/ loop: "{{ imagetarballs.files }}" diff --git a/ansible/roles/metacluster/tasks/components.yml b/ansible/roles/metacluster/tasks/components.yml index 220f941..dc80345 100644 --- a/ansible/roles/metacluster/tasks/components.yml +++ b/ansible/roles/metacluster/tasks/components.yml @@ -53,7 +53,8 @@ docker://{{ item }} \ docker-archive:./{{ ( item | regex_findall('[^/:]+'))[-2] }}.tar:{{ item }} chdir: /opt/metacluster/container-images - loop: "{{ (containerimages.results | map(attribute='stdout_lines') | flatten) + dependencies.container_images }}" + # loop: "{{ (containerimages.results | map(attribute='stdout_lines') | flatten) + dependencies.container_images }}" + loop: "{{ (containerimages.results | map(attribute='stdout_lines') | flatten) }}" # - name: Inject manifests # ansible.builtin.template: diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index 8ef1a6f..ba290c2 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -125,9 +125,10 @@ dependencies: - community.crypto - community.general - kubernetes.core + - vmware.vmware_rest - container_images: - - quay.io/skopeo/stable:v1.8.0 + # container_images: + # - quay.io/skopeo/stable:v1.8.0 static_binaries: - filename: tea @@ -139,11 +140,15 @@ dependencies: url: https://get.helm.sh/helm-v3.9.0-linux-amd64.tar.gz archive: compressed extra_opts: --strip-components=1 + - filename: skopeo + url: https://sn.itch.fyi/Repository/rel/skopeo + username: "{{ repo_username }}" + password: "{{ repo_password }}" - filename: yq url: http://github.com/mikefarah/yq/releases/download/v4.25.3/yq_linux_amd64 packages: - lvm2 + - python3-dnspython - python3-jmespath - python3-passlib - - skopeo diff --git a/packer/k8sbootstrap.pkr.hcl b/packer/k8sbootstrap.pkr.hcl index a60f873..bbc21f4 100644 --- a/packer/k8sbootstrap.pkr.hcl +++ b/packer/k8sbootstrap.pkr.hcl @@ -80,7 +80,9 @@ build { ] use_proxy = "false" extra_arguments = [ - "--extra-vars", "ansible_ssh_pass=${var.ssh_password}" + "--extra-vars", "ansible_ssh_pass=${var.ssh_password}", + "--extra-vars", "repo_username=${var.repo_username}", + "--extra-vars", "repo_password=${var.repo_password}" ] }