Compare commits
4 Commits
4fff9f8d80
...
41ccf2a5b9
| Author | SHA1 | Date | |
|---|---|---|---|
| 41ccf2a5b9 | |||
| 8f9cfe3b2f | |||
| 6a75237197 | |||
| b04aad12fb |
@@ -21,8 +21,15 @@
|
|||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Start the VM
|
- name: Ensure the installer environment is powered off
|
||||||
community.proxmox.proxmox_kvm:
|
community.proxmox.proxmox_kvm:
|
||||||
vmid: "{{ system_cfg.id }}"
|
vmid: "{{ system_cfg.id }}"
|
||||||
state: restarted
|
state: stopped
|
||||||
|
force: true
|
||||||
|
no_log: true
|
||||||
|
|
||||||
|
- name: Boot the installed OS
|
||||||
|
community.proxmox.proxmox_kvm:
|
||||||
|
vmid: "{{ system_cfg.id }}"
|
||||||
|
state: started
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
org_id: "{{ system_cfg.content.satellite.org }}"
|
org_id: "{{ system_cfg.content.satellite.org }}"
|
||||||
activationkey: "{{ system_cfg.content.satellite.activation_key }}"
|
activationkey: "{{ system_cfg.content.satellite.activation_key }}"
|
||||||
environment: "{{ system_cfg.content.satellite.environment | default(omit, true) }}"
|
environment: "{{ system_cfg.content.satellite.environment | default(omit, true) }}"
|
||||||
auto_attach: true
|
|
||||||
force_register: true
|
force_register: true
|
||||||
server_proxy_hostname: "{{ (system_cfg.content.proxy | urlsplit('hostname')) | default(omit, true) }}"
|
server_proxy_hostname: "{{ (system_cfg.content.proxy | urlsplit('hostname')) | default(omit, true) }}"
|
||||||
server_proxy_port: "{{ (system_cfg.content.proxy | urlsplit('port')) | default(omit, true) }}"
|
server_proxy_port: "{{ (system_cfg.content.proxy | urlsplit('port')) | default(omit, true) }}"
|
||||||
|
|||||||
@@ -54,6 +54,18 @@
|
|||||||
and 'No such file or directory' not in (configuration_enable_service_result.stderr | default(''))
|
and 'No such file or directory' not in (configuration_enable_service_result.stderr | default(''))
|
||||||
and 'does not exist' not in (configuration_enable_service_result.stderr | default(''))
|
and 'does not exist' not in (configuration_enable_service_result.stderr | default(''))
|
||||||
|
|
||||||
|
- name: Check for the EL qemu-guest-agent RPC allow-list
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /mnt/etc/sysconfig/qemu-ga
|
||||||
|
register: configuration_qga_sysconfig
|
||||||
|
|
||||||
|
- name: Allow clone-stamping RPCs in the EL qemu-guest-agent allow-list
|
||||||
|
when: configuration_qga_sysconfig.stat.exists
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /mnt/etc/sysconfig/qemu-ga
|
||||||
|
regexp: '^(FILTER_RPC_ARGS="--allow-rpcs=(?:(?!guest-exec)[^"])*)"'
|
||||||
|
replace: '\1,guest-exec,guest-exec-status,guest-file-open,guest-file-close,guest-file-read,guest-file-write"'
|
||||||
|
|
||||||
- name: Enable display manager for selected desktop
|
- name: Enable display manager for selected desktop
|
||||||
when:
|
when:
|
||||||
- _configuration_platform.init_system == 'systemd'
|
- _configuration_platform.init_system == 'systemd'
|
||||||
|
|||||||
@@ -73,28 +73,25 @@
|
|||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Detect RHEL ISO device
|
- name: Detect RHEL ISO device
|
||||||
ansible.builtin.command: lsblk -rno NAME,TYPE
|
ansible.builtin.command: lsblk -rbno NAME,TYPE,SIZE
|
||||||
register: environment_lsblk_result
|
register: environment_lsblk_result
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Select RHEL ISO device
|
- name: Select RHEL ISO device
|
||||||
vars:
|
vars:
|
||||||
_rom_devices: >-
|
_roms: >-
|
||||||
{{
|
{%- set out = [] -%}
|
||||||
environment_lsblk_result.stdout_lines
|
{%- for line in environment_lsblk_result.stdout_lines -%}
|
||||||
| map('split', ' ')
|
{%- set p = line.split() -%}
|
||||||
| selectattr('1', 'equalto', 'rom')
|
{%- if (p | length) >= 3 and p[1] == 'rom' -%}
|
||||||
| map('first')
|
{%- set _ = out.append({'name': p[0], 'size': p[2] | int}) -%}
|
||||||
| map('regex_replace', '^', '/dev/')
|
{%- endif -%}
|
||||||
| list
|
{%- endfor -%}
|
||||||
}}
|
{{ out }}
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
environment_rhel_iso_device: >-
|
environment_rhel_iso_device: >-
|
||||||
{{
|
{{ ('/dev/' ~ (_roms | sort(attribute='size') | last).name)
|
||||||
_rom_devices[-1]
|
if (_roms | length) > 0 else '/dev/sr1' }}
|
||||||
if _rom_devices | length > 1
|
|
||||||
else (_rom_devices[0] | default('/dev/sr1'))
|
|
||||||
}}
|
|
||||||
|
|
||||||
- name: Mount RHEL ISO
|
- name: Mount RHEL ISO
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
|
|||||||
Reference in New Issue
Block a user