Remove redundant task;Refactor packer vm name
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2023-04-05 16:51:42 +02:00
parent db090ac564
commit 4e6a0549b5
3 changed files with 5 additions and 9 deletions

View File

@ -62,7 +62,7 @@ steps:
./packer
- |
packer validate \
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
-var vm_name=${DRONE_COMMIT_SHA:0:10}-$(date -d @${DRONE_BUILD_CREATED} +%Y%m%d) \
-var docker_username=$${DOCKER_USERNAME} \
-var docker_password=$${DOCKER_PASSWORD} \
-var repo_username=$${REPO_USERNAME} \
@ -75,7 +75,7 @@ steps:
packer build \
-on-error=cleanup -timestamp-ui \
-only=vsphere-iso.bootstrap \
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
-var vm_name=${DRONE_COMMIT_SHA:0:10}-$(date -d @${DRONE_BUILD_CREATED} +%Y%m%d) \
-var docker_username=$${DOCKER_USERNAME} \
-var docker_password=$${DOCKER_PASSWORD} \
-var repo_username=$${REPO_USERNAME} \

View File

@ -1,9 +1,5 @@
- block:
- name: Lookup kubeadm container images
ansible.builtin.set_fact:
kubeadm_images: "{{ lookup('ansible.builtin.file', '/opt/metacluster/cluster-api/imagelist').splitlines() }}"
- name: Copy kubeadm container images to dedicated project
ansible.builtin.uri:
url: https://registry.{{ vapp['metacluster.fqdn'] }}/api/v2.0/projects/kubeadm/repositories/{{ ( item | regex_findall('([^:/]+)') )[-2] }}/artifacts?from=library/{{ item | replace('/', '%2F') | replace(':', '%3A') }}
@ -12,7 +8,7 @@
Authorization: "Basic {{ ('admin:' ~ vapp['metacluster.password']) | b64encode }}"
body:
from: "{{ item }}"
loop: "{{ kubeadm_images }}"
loop: "{{ lookup('ansible.builtin.file', '/opt/metacluster/cluster-api/imagelist').splitlines() }}"
module_defaults:
ansible.builtin.uri:

View File

@ -6,7 +6,7 @@ packer {
build {
source "vsphere-iso.ubuntu" {
name = "bootstrap"
vm_name = "ova.bootstrap-${var.vm_name}"
vm_name = "bld_${var.vm_name}_bootstrap"
export {
images = false
@ -16,7 +16,7 @@ build {
source "vsphere-iso.ubuntu" {
name = "upgrade"
vm_name = "ova.upgrade-${var.vm_name}"
vm_name = "bld_${var.vm_name}_upgrade"
export {
images = false