From ad75900e9c9506be40c77a502ea011119e9bc987 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 13 Jun 2021 13:08:55 +0700 Subject: [PATCH] Render Ignition JSON from Butane YAML --- metal/roles/pxe-boot/tasks/server.yml | 18 +++++++++++++++++- .../templates/http/ignition/ignition.yaml | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/metal/roles/pxe-boot/tasks/server.yml b/metal/roles/pxe-boot/tasks/server.yml index 133f4b22..061af217 100644 --- a/metal/roles/pxe-boot/tasks/server.yml +++ b/metal/roles/pxe-boot/tasks/server.yml @@ -53,6 +53,22 @@ dest: "{{ role_path }}/build/http/ignition/{{ hostvars[item]['mac'] }}.yaml" loop: "{{ groups['metal'] }}" +- name: Render Ignition config from Butane config + docker_container: + name: butane + image: quay.io/coreos/butane:release + auto_remove: yes + volumes: + - "{{ role_path }}/build/http/ignition:/local/src" + working_dir: /local/src + command: + - --pretty + - --strict + - "{{ hostvars[item]['mac'] }}.yaml" + - --output + - "{{ hostvars[item]['mac'] }}.json" + loop: "{{ groups['metal'] }}" + - name: Start ephemeral PXE server docker_compose: project_src: "{{ role_path }}/build" @@ -61,4 +77,4 @@ build: yes recreate: always notify: - - Stop PXE server + - Stop ephemeral PXE server diff --git a/metal/roles/pxe-boot/templates/http/ignition/ignition.yaml b/metal/roles/pxe-boot/templates/http/ignition/ignition.yaml index de1d85d5..6280ae09 100644 --- a/metal/roles/pxe-boot/templates/http/ignition/ignition.yaml +++ b/metal/roles/pxe-boot/templates/http/ignition/ignition.yaml @@ -1,5 +1,6 @@ variant: fcos version: 1.3.0 + passwd: users: - name: core