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: |