diff --git a/ansible/playbooks/blueprint_preparation.yaml b/ansible/playbooks/blueprint_preparation.yaml index 9ab8fb2..bea6b0f 100644 --- a/ansible/playbooks/blueprint_preparation.yaml +++ b/ansible/playbooks/blueprint_preparation.yaml @@ -18,14 +18,6 @@ ansible.builtin.debug: var: microshift_info.stdout_lines - - name: Display ssh package information - ansible.builtin.debug: - var: ADMIN_SSH_PUBLIC_KEY - - - name: Display password package information - ansible.builtin.debug: - var: ADMIN_PASSWORD - - name: Install mkpasswd and podman packages become: true ansible.builtin.dnf: @@ -39,76 +31,72 @@ register: admin_password_hash changed_when: false - - name: Update kiosk.toml with admin password hash and SSH public key + - name: Set admin password in kiosk.toml ansible.builtin.lineinfile: path: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml" - regexp: "{{ item.regexp }}" - 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 }}' } + regexp: '^password =.*$' + line: 'password = "{{ ADMIN_PASSWORD }}"' + backrefs: yes + - name: Set admin SSH public key in kiosk.toml + ansible.builtin.lineinfile: + path: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml" + regexp: '^key =.*$' + line: 'key = "{{ ADMIN_SSH_PUBLIC_KEY }}"' + backrefs: yes - name: Add custom packages source to composer ansible.builtin.shell: | - composer-cli sources add <