|
@@ -67,13 +67,18 @@
|
|
content_sources: "{{ lookup('ansible.builtin.file', ansible_facts['user_dir'] + '/mirror/working-dir/cluster-resources/idms-oc-mirror.yaml')
|
|
content_sources: "{{ lookup('ansible.builtin.file', ansible_facts['user_dir'] + '/mirror/working-dir/cluster-resources/idms-oc-mirror.yaml')
|
|
| ansible.builtin.from_yaml_all }}"
|
|
| ansible.builtin.from_yaml_all }}"
|
|
|
|
|
|
|
|
+ - name: Set the fact determining installation type (required for templating).
|
|
|
|
+ ansible.builtin.set_fact:
|
|
|
|
+ install_type: iso
|
|
|
|
+
|
|
- name: Ensure install-config is there.
|
|
- name: Ensure install-config is there.
|
|
ansible.builtin.template:
|
|
ansible.builtin.template:
|
|
- src: templates/install-config-embed.yaml.j2
|
|
|
|
|
|
+ src: templates/install-config-template.yaml.j2
|
|
dest: "{{ ansible_facts['user_dir'] }}/install-config-embed.yaml"
|
|
dest: "{{ ansible_facts['user_dir'] }}/install-config-embed.yaml"
|
|
mode: 0644
|
|
mode: 0644
|
|
owner: student
|
|
owner: student
|
|
group: student
|
|
group: student
|
|
|
|
+ register: updated_install_config
|
|
|
|
|
|
- name: Remove the installation directory if so required.
|
|
- name: Remove the installation directory if so required.
|
|
ansible.builtin.file:
|
|
ansible.builtin.file:
|
|
@@ -97,7 +102,7 @@
|
|
mode: 0644
|
|
mode: 0644
|
|
register: published_install_config
|
|
register: published_install_config
|
|
when:
|
|
when:
|
|
- - (not install_log.stat.exists) or (recreate_cluster_dir is defined)
|
|
|
|
|
|
+ - (not install_log.stat.exists) or (recreate_cluster_dir is defined) or updated_install_config.changed
|
|
|
|
|
|
- name: Create installation manifests if install config was published.
|
|
- name: Create installation manifests if install config was published.
|
|
ansible.builtin.command:
|
|
ansible.builtin.command:
|
|
@@ -141,13 +146,19 @@
|
|
- recreated_sno_cfg is defined
|
|
- recreated_sno_cfg is defined
|
|
- recreated_sno_cfg.changed
|
|
- recreated_sno_cfg.changed
|
|
|
|
|
|
|
|
+ - name: Check if custom ISO is there.
|
|
|
|
+ ansible.builtin.stat:
|
|
|
|
+ path: "{{ ansible_facts['user_dir'] }}/sno-embedded-cfg.iso"
|
|
|
|
+ get_attributes: no
|
|
|
|
+ get_checksum: no
|
|
|
|
+ get_mime: no
|
|
|
|
+ register: custom_iso
|
|
|
|
+
|
|
- name: Embed install config in the ISO.
|
|
- name: Embed install config in the ISO.
|
|
ansible.builtin.command:
|
|
ansible.builtin.command:
|
|
cmd: coreos-installer iso ignition embed -fi ./embed/bootstrap-in-place-for-live-iso.ign -o sno-embedded-cfg.iso {{ ansible_facts['user_dir'] }}/Downloads/rhcos-418.94.202501221327-0-live.x86_64.iso
|
|
cmd: coreos-installer iso ignition embed -fi ./embed/bootstrap-in-place-for-live-iso.ign -o sno-embedded-cfg.iso {{ ansible_facts['user_dir'] }}/Downloads/rhcos-418.94.202501221327-0-live.x86_64.iso
|
|
chdir: "{{ ansible_facts['user_dir'] }}"
|
|
chdir: "{{ ansible_facts['user_dir'] }}"
|
|
- when:
|
|
|
|
- - recreated_sno_cfg is defined
|
|
|
|
- - recreated_sno_cfg.changed
|
|
|
|
|
|
+ when: not custom_iso.exists
|
|
|
|
|
|
- name: Copy the ISO file to target machine and write it to /dev/sdb
|
|
- name: Copy the ISO file to target machine and write it to /dev/sdb
|
|
hosts: master01.ocp4.example.com
|
|
hosts: master01.ocp4.example.com
|