From ea20b1290cdbd462bf9a8c370853de4b90951a3a Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Tue, 26 Jul 2022 16:50:50 +0200 Subject: [PATCH] Add initial steps for workload cluster staging;Include govc (temporarily) --- ansible/playbook.yml | 1 + ansible/roles/metacluster/tasks/main.yml | 5 ++++- ansible/roles/metacluster/tasks/staging.yml | 14 ++++++++++++++ ansible/vars/metacluster.yml | 3 +++ ansible/vars/workloadcluster.yml | 5 +++++ 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/metacluster/tasks/staging.yml create mode 100644 ansible/vars/workloadcluster.yml diff --git a/ansible/playbook.yml b/ansible/playbook.yml index a4bf947..574072d 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -3,6 +3,7 @@ gather_facts: false vars_files: - metacluster.yml + - workloadcluster.yml become: true roles: - os diff --git a/ansible/roles/metacluster/tasks/main.yml b/ansible/roles/metacluster/tasks/main.yml index 3d4f040..81d2a4c 100644 --- a/ansible/roles/metacluster/tasks/main.yml +++ b/ansible/roles/metacluster/tasks/main.yml @@ -1,11 +1,14 @@ - name: Pre-stage K3s components import_tasks: k3s.yml -- name: Pre-stage meta components +- name: Pre-stage meta-cluster components import_tasks: components.yml - name: Pre-stage IaC repositories import_tasks: config.yml +- name: Pre-stage workload-cluster components + import_tasks: staging.yml + - name: Cleanup import_tasks: cleanup.yml diff --git a/ansible/roles/metacluster/tasks/staging.yml b/ansible/roles/metacluster/tasks/staging.yml new file mode 100644 index 0000000..4c32463 --- /dev/null +++ b/ansible/roles/metacluster/tasks/staging.yml @@ -0,0 +1,14 @@ +- name: Create folder structure(s) + ansible.builtin.file: + path: "{{ item }}" + state: directory + loop: + - /opt/workloadcluster/node-templates + +- name: Download images + ansible.builtin.uri: + url: "{{ item.url }}" + dest: /opt/workloadcluster/node-templates/{{ item.name }} + loop: "{{ downstream.node_templates }}" + loop_control: + label: "{{ item.name }}" diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index 10d933b..8ef1a6f 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -132,6 +132,9 @@ dependencies: static_binaries: - filename: tea url: https://dl.gitea.io/tea/0.8.0/tea-0.8.0-linux-amd64 + - filename: govc + url: https://github.com/vmware/govmomi/releases/download/v0.29.0/govc_Linux_x86_64.tar.gz + archive: compressed - filename: helm url: https://get.helm.sh/helm-v3.9.0-linux-amd64.tar.gz archive: compressed diff --git a/ansible/vars/workloadcluster.yml b/ansible/vars/workloadcluster.yml new file mode 100644 index 0000000..879b594 --- /dev/null +++ b/ansible/vars/workloadcluster.yml @@ -0,0 +1,5 @@ +downstream: + + node_templates: + - url: https://stable.release.flatcar-linux.net/amd64-usr/3227.2.0/flatcar_production_vmware_ova.ova + name: flatcar.ova