You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
3.4 KiB
102 lines
3.4 KiB
- name: Create the initial ostree repo
|
|
hosts: all
|
|
vars_files: ../credentials.yaml
|
|
tasks:
|
|
- name: Extract userspace architecture
|
|
ansible.builtin.set_fact:
|
|
userspace_arch: "{{ ansible_facts['userspace_architecture']}}"
|
|
- name: Enable required rhocp repositories using subscription-manager
|
|
become: true
|
|
ansible.builtin.command:
|
|
cmd: "sudo subscription-manager repos --enable rhocp-4.14-for-rhel-9-{{ userspace_arch }}-rpms --enable fast-datapath-for-rhel-9-{{ userspace_arch }}-rpms"
|
|
- name: Get information about the microshift package
|
|
ansible.builtin.command:
|
|
cmd: "dnf info microshift"
|
|
register: microshift_info
|
|
|
|
- name: Display microshift package information
|
|
ansible.builtin.debug:
|
|
var: microshift_info.stdout_lines
|
|
|
|
- name: Install mkpasswd and podman packages
|
|
become: true
|
|
ansible.builtin.dnf:
|
|
name:
|
|
- mkpasswd
|
|
- podman
|
|
state: present
|
|
|
|
- name: Generate bcrypt hash of the admin password
|
|
command: mkpasswd -m bcrypt "{{ ADMIN_PASSWORD }}"
|
|
register: admin_password_hash
|
|
changed_when: false
|
|
|
|
- name: Set admin password in kiosk.toml
|
|
ansible.builtin.lineinfile:
|
|
path: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml"
|
|
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: |
|
|
echo "
|
|
check_gpg = false
|
|
check_ssl = false
|
|
id = 'custom'
|
|
name = 'custom packages for RHEL'
|
|
system = false
|
|
type = 'yum-baseurl'
|
|
url = 'file://{{ repo_location }}'
|
|
" | composer-cli sources add /dev/stdin
|
|
|
|
- name: Add RH OCP 4.14 source to composer
|
|
ansible.builtin.shell: |
|
|
echo "
|
|
id = 'rhocp-4.14'
|
|
name = 'Red Hat OpenShift Container Platform 4.14 for RHEL 9'
|
|
type = 'yum-baseurl'
|
|
url = 'https://cdn.redhat.com/content/dist/layered/rhel9/{{ ansible_architecture }}/rhocp/4.14/os'
|
|
check_gpg = true
|
|
check_ssl = true
|
|
system = false
|
|
rhsm = true
|
|
" | composer-cli sources add /dev/stdin
|
|
|
|
- name: Add Fast Datapath source to composer
|
|
ansible.builtin.shell: |
|
|
echo "
|
|
id = 'fast-datapath'
|
|
name = 'Fast Datapath for RHEL 9'
|
|
type = 'yum-baseurl'
|
|
url = 'https://cdn.redhat.com/content/dist/layered/rhel9/{{ ansible_architecture }}/fast-datapath/os'
|
|
check_gpg = true
|
|
check_ssl = true
|
|
system = false
|
|
rhsm = true
|
|
" | composer-cli sources add /dev/stdin
|
|
|
|
- name: Add EPEL source to composer
|
|
ansible.builtin.shell: |
|
|
echo "
|
|
id = 'epel'
|
|
name = 'Extra Packages for Enterprise Linux'
|
|
type = 'yum-baseurl'
|
|
url = 'http://mirror.in2p3.fr/pub/epel/9/Everything/{{ ansible_architecture }}/'
|
|
check_gpg = false
|
|
check_ssl = false
|
|
system = false
|
|
rhsm = false
|
|
" | composer-cli sources add /dev/stdin
|
|
|
|
- name: Push Blueprint
|
|
infra.osbuild.push_blueprint:
|
|
src: "{{ ansible_env.HOME }}/red-hat-kiosk/imagebuilder/kiosk.toml"
|
|
|