From 3e7aca4c8a5647c2448f4af459d2c68797825637 Mon Sep 17 00:00:00 2001 From: ePietry Date: Wed, 27 Mar 2024 15:21:47 +0100 Subject: [PATCH] update --- .gitignore | 3 ++- ansible/playbooks/blueprint_preparation.yaml | 23 ++++++++++---------- ansible/playbooks/credentials.yaml | 2 ++ 3 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 ansible/playbooks/credentials.yaml diff --git a/.gitignore b/.gitignore index 2cb147e..7848b25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ ansible/inventory.yaml .vscode -ansible/credentials.yaml \ No newline at end of file +ansible/credentials.yaml +ansible/config.yaml \ No newline at end of file diff --git a/ansible/playbooks/blueprint_preparation.yaml b/ansible/playbooks/blueprint_preparation.yaml index 9475252..9ab8fb2 100644 --- a/ansible/playbooks/blueprint_preparation.yaml +++ b/ansible/playbooks/blueprint_preparation.yaml @@ -1,14 +1,10 @@ - name: Create the initial ostree repo hosts: all - + vars_files: ../credentials.yaml 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'] }}" + userspace_arch: "{{ ansible_facts['userspace_architecture']}}" - name: Enable required rhocp repositories using subscription-manager become: true ansible.builtin.command: @@ -22,6 +18,13 @@ 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 @@ -43,13 +46,9 @@ 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: | diff --git a/ansible/playbooks/credentials.yaml b/ansible/playbooks/credentials.yaml new file mode 100644 index 0000000..bf97294 --- /dev/null +++ b/ansible/playbooks/credentials.yaml @@ -0,0 +1,2 @@ +user: joe +home: /home/joe