From 3e53bc653ba41e0050afa1459f494b633ce9f85f Mon Sep 17 00:00:00 2001 From: ePietry Date: Wed, 27 Mar 2024 15:08:28 +0100 Subject: [PATCH] update blueprints prep --- .gitignore | 3 +-- ansible/playbooks/blueprint_preparation.yaml | 14 +++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1a80ca8..65451b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ ansible/inventory.yaml .vscode -ansible/test -ansible/test.pub \ No newline at end of file +ansible/credentials \ No newline at end of file diff --git a/ansible/playbooks/blueprint_preparation.yaml b/ansible/playbooks/blueprint_preparation.yaml index bf825bb..9475252 100644 --- a/ansible/playbooks/blueprint_preparation.yaml +++ b/ansible/playbooks/blueprint_preparation.yaml @@ -1,6 +1,11 @@ - name: Create the initial ostree repo hosts: all + tasks: + - name: Display microshift package information + ansible.builtin.debug: + var: "{{ ADMIN_SSH_PUBLIC_KEY }}" + - name: Extract userspace architecture ansible.builtin.set_fact: userspace_arch: "{{ ansible_facts['userspace_architecture'] }}" @@ -17,6 +22,7 @@ ansible.builtin.debug: var: microshift_info.stdout_lines + - name: Install mkpasswd and podman packages become: true ansible.builtin.dnf: @@ -37,7 +43,13 @@ line: "{{ item.line }}" loop: - { regexp: '^__ADMIN_PASSWORD__=', line: '__ADMIN_PASSWORD__={{ admin_password_hash.stdout }}' } - - { regexp: '^__ADMIN_SSH_PUBLIC_KEY__=', line: '__ADMIN_SSH_PUBLIC_KEY__={{ ADMIN_SSH_PUBLIC_KEY }}' } + + - name: Replace ADMIN_SSH_PUBLIC_KEY placeholder with the actual key + ansible.builtin.lineinfile: + path: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml" + regexp: '^__ADMIN_SSH_PUBLIC_KEY__=' + line: '__ADMIN_SSH_PUBLIC_KEY__={{ ADMIN_SSH_PUBLIC_KEY }}' + backrefs: true - name: Add custom packages source to composer ansible.builtin.shell: |