Browse Source

blueprint prepa update

ca-cert-and-multi-ks
ePietry 2 years ago
parent
commit
50fbb6ebf0
  1. 86
      ansible/playbooks/blueprint_preparation.yaml

86
ansible/playbooks/blueprint_preparation.yaml

@ -18,14 +18,6 @@
ansible.builtin.debug: ansible.builtin.debug:
var: microshift_info.stdout_lines 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 - name: Install mkpasswd and podman packages
become: true become: true
ansible.builtin.dnf: ansible.builtin.dnf:
@ -39,76 +31,72 @@
register: admin_password_hash register: admin_password_hash
changed_when: false 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: ansible.builtin.lineinfile:
path: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml" path: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml"
regexp: "{{ item.regexp }}" regexp: '^password =.*$'
line: "{{ item.line }}" line: 'password = "{{ ADMIN_PASSWORD }}"'
loop: backrefs: yes
- { 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: 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 - name: Add custom packages source to composer
ansible.builtin.shell: | ansible.builtin.shell: |
composer-cli sources add <<EOF echo "
check_gpg = false check_gpg = false
check_ssl = false check_ssl = false
id = "custom" id = 'custom'
name = "custom packages for RHEL" name = 'custom packages for RHEL'
system = false system = false
type = "yum-baseurl" type = 'yum-baseurl'
url = "file://{{ repo_location }}" url = 'file://{{ repo_location }}'
EOF " | composer-cli sources add /dev/stdin
args:
executable: /bin/bash
- name: Add rhocp-4.14 source to composer - name: Add RH OCP 4.14 source to composer
ansible.builtin.shell: | ansible.builtin.shell: |
composer-cli sources add <<EOF echo "
id = "rhocp-4.14" id = 'rhocp-4.14'
name = "Red Hat OpenShift Container Platform 4.14 for RHEL 9" name = 'Red Hat OpenShift Container Platform 4.14 for RHEL 9'
type = "yum-baseurl" type = 'yum-baseurl'
url = "https://cdn.redhat.com/content/dist/layered/rhel9/{{ ansible_architecture }}/rhocp/4.14/os" url = 'https://cdn.redhat.com/content/dist/layered/rhel9/{{ ansible_architecture }}/rhocp/4.14/os'
check_gpg = true check_gpg = true
check_ssl = true check_ssl = true
system = false system = false
rhsm = true rhsm = true
EOF " | composer-cli sources add /dev/stdin
args:
executable: /bin/bash
- name: Add fast-datapath source to composer - name: Add Fast Datapath source to composer
ansible.builtin.shell: | ansible.builtin.shell: |
composer-cli sources add <<EOF echo "
id = "fast-datapath" id = 'fast-datapath'
name = "Fast Datapath for RHEL 9" name = 'Fast Datapath for RHEL 9'
type = "yum-baseurl" type = 'yum-baseurl'
url = "https://cdn.redhat.com/content/dist/layered/rhel9/{{ ansible_architecture }}/fast-datapath/os" url = 'https://cdn.redhat.com/content/dist/layered/rhel9/{{ ansible_architecture }}/fast-datapath/os'
check_gpg = true check_gpg = true
check_ssl = true check_ssl = true
system = false system = false
rhsm = true rhsm = true
EOF " | composer-cli sources add /dev/stdin
args:
executable: /bin/bash
- name: Add EPEL source to composer - name: Add EPEL source to composer
ansible.builtin.shell: | ansible.builtin.shell: |
composer-cli sources add <<EOF echo "
id = "epel" id = 'epel'
name = "Extra Packages for Enterprise Linux" name = 'Extra Packages for Enterprise Linux'
type = "yum-baseurl" type = 'yum-baseurl'
url = "http://mirror.in2p3.fr/pub/epel/9/Everything/{{ ansible_architecture }}/" url = 'http://mirror.in2p3.fr/pub/epel/9/Everything/{{ ansible_architecture }}/'
check_gpg = false check_gpg = false
check_ssl = false check_ssl = false
system = false system = false
rhsm = false rhsm = false
EOF " | composer-cli sources add /dev/stdin
args:
executable: /bin/bash
- name: Push Blueprint - name: Push Blueprint
infra.osbuild.push_blueprint: infra.osbuild.push_blueprint:
src: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml" src: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml"

Loading…
Cancel
Save