3 Commits

Author SHA1 Message Date
matt
b5399283a1 try this 2025-07-11 16:06:24 -06:00
matt
b9054543cb syntax issue 2025-07-11 16:03:16 -06:00
matt
beb47d4f8e attempt to fix annoying snapshot/inventory sync issue with CNV 2025-07-11 16:00:06 -06:00
28 changed files with 124 additions and 111 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -14,4 +14,13 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: ./.github/workflows/run-pc.sh - run: ./.github/workflows/run-pc.sh
shell: bash shell: bash
pre-commit-24:
container:
image: quay.io/ansible-product-demos/apd-ee-24
options: --user root
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: USE_PYTHON=python3.9 ./.github/workflows/run-pc.sh
shell: bash

View File

@@ -1,7 +1,6 @@
#!/bin/bash -x #!/bin/bash -x
# should no longer need this dnf install git-lfs -y
#dnf install git-lfs -y
PYTHON_VARIANT="${USE_PYTHON:-python3.11}" PYTHON_VARIANT="${USE_PYTHON:-python3.11}"
PATH="$PATH:$HOME/.local/bin" PATH="$PATH:$HOME/.local/bin"

View File

@@ -16,7 +16,7 @@ repos:
- repo: https://github.com/ansible/ansible-lint.git - repo: https://github.com/ansible/ansible-lint.git
# get latest release tag from https://github.com/ansible/ansible-lint/releases/ # get latest release tag from https://github.com/ansible/ansible-lint/releases/
rev: v25.7.0 rev: v6.20.3
hooks: hooks:
- id: ansible-lint - id: ansible-lint
additional_dependencies: additional_dependencies:

View File

@@ -17,12 +17,12 @@
filters: filters:
name: "{{ aws_image_filter }}" name: "{{ aws_image_filter }}"
architecture: "{{ aws_image_architecture | default(omit) }}" architecture: "{{ aws_image_architecture | default(omit) }}"
register: aws_amis register: amis
- name: AWS| CREATE VM | save ami - name: AWS| CREATE VM | save ami
ansible.builtin.set_fact: ansible.builtin.set_fact:
aws_instance_ami: > aws_instance_ami: >
{{ (aws_amis.images | selectattr('name', 'defined') | sort(attribute='creation_date'))[-2] }} {{ (amis.images | selectattr('name', 'defined') | sort(attribute='creation_date'))[-2] }}
- name: AWS| CREATE VM | create instance - name: AWS| CREATE VM | create instance
amazon.aws.ec2_instance: amazon.aws.ec2_instance:

View File

@@ -10,14 +10,14 @@
wait: true wait: true
- name: AWS | RESTORE VM | get volumes - name: AWS | RESTORE VM | get volumes
register: aws_r_vol_info register: r_vol_info
amazon.aws.ec2_vol_info: amazon.aws.ec2_vol_info:
region: "{{ aws_region }}" region: "{{ aws_region }}"
filters: filters:
attachment.instance-id: "{{ instance_id }}" attachment.instance-id: "{{ instance_id }}"
- name: AWS | RESTORE VM | detach volumes - name: AWS | RESTORE VM | detach volumes
loop: "{{ aws_r_vol_info.volumes }}" loop: "{{ r_vol_info.volumes }}"
loop_control: loop_control:
loop_var: volume loop_var: volume
label: "{{ volume.id }}" label: "{{ volume.id }}"
@@ -40,7 +40,7 @@
- name: AWS | RESTORE VM | get all snapshots - name: AWS | RESTORE VM | get all snapshots
when: inventory_hostname not in aws_snapshots when: inventory_hostname not in aws_snapshots
register: aws_r_snapshots register: r_snapshots
amazon.aws.ec2_snapshot_info: amazon.aws.ec2_snapshot_info:
region: "{{ aws_region }}" region: "{{ aws_region }}"
filters: filters:
@@ -51,7 +51,7 @@
amazon.aws.ec2_vol: amazon.aws.ec2_vol:
region: "{{ aws_region }}" region: "{{ aws_region }}"
instance: "{{ instance_id }}" instance: "{{ instance_id }}"
snapshot: "{{ aws_r_snapshots.snapshots[0].snapshot_id }}" snapshot: "{{ r_snapshots.snapshots[0].snapshot_id }}"
device_name: "/dev/sda1" device_name: "/dev/sda1"
- name: AWS | RESTORE VM | start vm - name: AWS | RESTORE VM | start vm

View File

@@ -12,18 +12,18 @@
file: snapshot_vm.yml file: snapshot_vm.yml
- name: AWS | SNAPSHOT VM | get volumes - name: AWS | SNAPSHOT VM | get volumes
register: aws_r_vol_info register: r_vol_info
amazon.aws.ec2_vol_info: amazon.aws.ec2_vol_info:
region: "{{ aws_region }}" region: "{{ aws_region }}"
filters: filters:
attachment.instance-id: "{{ instance_id }}" attachment.instance-id: "{{ instance_id }}"
- name: AWS | SNAPSHOT VM | take snapshots - name: AWS | SNAPSHOT VM | take snapshots
loop: "{{ aws_r_vol_info.volumes }}" loop: "{{ r_vol_info.volumes }}"
loop_control: loop_control:
loop_var: volume loop_var: volume
label: "{{ volume.id }}" label: "{{ volume.id }}"
register: aws_r_snapshots register: r_snapshots
amazon.aws.ec2_snapshot: amazon.aws.ec2_snapshot:
region: "{{ aws_region }}" region: "{{ aws_region }}"
volume_id: "{{ volume.id }}" volume_id: "{{ volume.id }}"
@@ -32,11 +32,11 @@
- name: AWS | SNAPSHOT VM | format snapshot stat - name: AWS | SNAPSHOT VM | format snapshot stat
ansible.builtin.set_fact: ansible.builtin.set_fact:
aws_snapshot_stat: snapshot_stat:
- key: "{{ inventory_hostname }}" - key: "{{ inventory_hostname }}"
value: "{{ aws_r_snapshots.results | json_query(aws_ec2_snapshot_query) }}" value: "{{ r_snapshots.results | json_query(aws_ec2_snapshot_query) }}"
- name: AWS | SNAPSHOT VM | record snapshot with host key - name: AWS | SNAPSHOT VM | record snapshot with host key
ansible.builtin.set_stats: ansible.builtin.set_stats:
data: data:
aws_snapshots: "{{ aws_snapshot_stat | items2dict }}" aws_snapshots: "{{ snapshot_stat | items2dict }}"

View File

@@ -17,14 +17,14 @@
kind: Route kind: Route
name: "{{ eda_controller_project_app_name }}" name: "{{ eda_controller_project_app_name }}"
namespace: "{{ eda_controller_project }}" namespace: "{{ eda_controller_project }}"
register: eda_controller_r_eda_route register: r_eda_route
until: eda_controller_r_eda_route.resources[0].spec.host is defined until: r_eda_route.resources[0].spec.host is defined
retries: 30 retries: 30
delay: 45 delay: 45
- name: Get eda-controller route hostname - name: Get eda-controller route hostname
ansible.builtin.set_fact: ansible.builtin.set_fact:
eda_controller_hostname: "{{ eda_controller_r_eda_route.resources[0].spec.host }}" eda_controller_hostname: "{{ r_eda_route.resources[0].spec.host }}"
- name: Wait for eda_controller to be running - name: Wait for eda_controller to be running
ansible.builtin.uri: ansible.builtin.uri:
@@ -36,8 +36,8 @@
validate_certs: false validate_certs: false
body_format: json body_format: json
status_code: 200 status_code: 200
register: eda_controller_r_result register: r_result
until: not eda_controller_r_result.failed until: not r_result.failed
retries: 60 retries: 60
delay: 45 delay: 45

View File

@@ -3,7 +3,7 @@
redhat.openshift_virtualization.kubevirt_vm_info: redhat.openshift_virtualization.kubevirt_vm_info:
name: "{{ item }}" name: "{{ item }}"
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
register: snapshot_state register: state
- name: Stop VirtualMachine - name: Stop VirtualMachine
redhat.openshift_virtualization.kubevirt_vm: redhat.openshift_virtualization.kubevirt_vm:
@@ -11,7 +11,7 @@
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
running: false running: false
wait: true wait: true
when: snapshot_state.resources.0.spec.running when: state.resources.0.spec.running
- name: Create a VirtualMachineSnapshot - name: Create a VirtualMachineSnapshot
kubernetes.core.k8s: kubernetes.core.k8s:
@@ -29,7 +29,7 @@
wait: true wait: true
wait_condition: wait_condition:
type: Ready type: Ready
register: snapshot_snapshot register: snapshot
- name: Start VirtualMachine - name: Start VirtualMachine
redhat.openshift_virtualization.kubevirt_vm: redhat.openshift_virtualization.kubevirt_vm:
@@ -37,13 +37,13 @@
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
running: true running: true
wait: true wait: true
when: snapshot_state.resources.0.spec.running when: state.resources.0.spec.running
- name: Export snapshot name - name: Export snapshot name
ansible.builtin.set_stats: ansible.builtin.set_stats:
data: data:
restore_snapshot_name: "{{ snapshot_snapshot.result.metadata.name }}" restore_snapshot_name: "{{ snapshot.result.metadata.name }}"
- name: Output snapshot name - name: Output snapshot name
ansible.builtin.debug: ansible.builtin.debug:
msg: "Successfully created snapshot {{ snapshot_snapshot.result.metadata.name }}" msg: "Successfully created snapshot {{ snapshot.result.metadata.name }}"

View File

@@ -3,18 +3,18 @@
redhat.openshift_virtualization.kubevirt_vm_info: redhat.openshift_virtualization.kubevirt_vm_info:
name: "{{ item }}" name: "{{ item }}"
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
register: snapshot_state register: state
- name: List snapshots - name: List snapshots
kubernetes.core.k8s_info: kubernetes.core.k8s_info:
api_version: snapshot.kubevirt.io/v1alpha1 api_version: snapshot.kubevirt.io/v1alpha1
kind: VirtualMachineSnapshot kind: VirtualMachineSnapshot
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
register: snapshot_snapshot register: snapshot
- name: Set snapshot name for {{ item }} - name: Set snapshot name for {{ item }}
ansible.builtin.set_fact: ansible.builtin.set_fact:
snapshot_latest_snapshot: "{{ snapshot_snapshot.resources | selectattr('spec.source.name', 'equalto', item) | sort(attribute='metadata.creationTimestamp') | first }}" latest_snapshot: "{{ snapshot.resources | selectattr('spec.source.name', 'equalto', item) | sort(attribute='metadata.creationTimestamp') | first }}"
- name: Stop VirtualMachine - name: Stop VirtualMachine
redhat.openshift_virtualization.kubevirt_vm: redhat.openshift_virtualization.kubevirt_vm:
@@ -22,7 +22,7 @@
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
running: false running: false
wait: true wait: true
when: snapshot_state.resources.0.spec.running when: state.resources.0.spec.running
- name: Restore a VirtualMachineSnapshot - name: Restore a VirtualMachineSnapshot
kubernetes.core.k8s: kubernetes.core.k8s:
@@ -30,14 +30,14 @@
apiVersion: snapshot.kubevirt.io/v1alpha1 apiVersion: snapshot.kubevirt.io/v1alpha1
kind: VirtualMachineRestore kind: VirtualMachineRestore
metadata: metadata:
generateName: "{{ snapshot_latest_snapshot.metadata.generateName }}" generateName: "{{ latest_snapshot.metadata.generateName }}"
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
spec: spec:
target: target:
apiGroup: kubevirt.io apiGroup: kubevirt.io
kind: VirtualMachine kind: VirtualMachine
name: "{{ item }}" name: "{{ item }}"
virtualMachineSnapshotName: "{{ snapshot_latest_snapshot.metadata.name }}" virtualMachineSnapshotName: "{{ latest_snapshot.metadata.name }}"
wait: true wait: true
wait_condition: wait_condition:
type: Ready type: Ready
@@ -48,4 +48,4 @@
namespace: "{{ vm_namespace }}" namespace: "{{ vm_namespace }}"
running: true running: true
wait: true wait: true
when: snapshot_state.resources.0.spec.running when: state.resources.0.spec.running

View File

@@ -8,12 +8,12 @@
check_mode: false check_mode: false
- name: Upgrade packages (yum) - name: Upgrade packages (yum)
ansible.legacy.dnf: ansible.builtin.yum:
name: '*' name: '*'
state: latest # noqa: package-latest - Intended to update packages to latest state: latest # noqa: package-latest - Intended to update packages to latest
exclude: "{{ exclude_packages }}" exclude: "{{ exclude_packages }}"
when: ansible_pkg_mgr == "yum" when: ansible_pkg_mgr == "yum"
register: patch_linux_patchingresult_yum register: patchingresult_yum
- name: Upgrade packages (dnf) - name: Upgrade packages (dnf)
ansible.builtin.dnf: ansible.builtin.dnf:
@@ -21,17 +21,17 @@
state: latest # noqa: package-latest - Intended to update packages to latest state: latest # noqa: package-latest - Intended to update packages to latest
exclude: "{{ exclude_packages }}" exclude: "{{ exclude_packages }}"
when: ansible_pkg_mgr == "dnf" when: ansible_pkg_mgr == "dnf"
register: patch_linux_patchingresult_dnf register: patchingresult_dnf
- name: Check to see if we need a reboot - name: Check to see if we need a reboot
ansible.builtin.command: needs-restarting -r ansible.builtin.command: needs-restarting -r
register: patch_linux_result register: result
changed_when: patch_linux_result.rc == 1 changed_when: result.rc == 1
failed_when: patch_linux_result.rc > 1 failed_when: result.rc > 1
check_mode: false check_mode: false
- name: Reboot Server if Necessary - name: Reboot Server if Necessary
ansible.builtin.reboot: ansible.builtin.reboot:
when: when:
- patch_linux_result.rc == 1 - result.rc == 1
- allow_reboot - allow_reboot

View File

@@ -12,4 +12,4 @@
category_names: "{{ win_update_categories | default(omit) }}" category_names: "{{ win_update_categories | default(omit) }}"
reboot: "{{ allow_reboot }}" reboot: "{{ allow_reboot }}"
state: installed state: installed
register: patch_windows_patchingresult register: patchingresult

View File

@@ -35,17 +35,17 @@
<td>{{hostvars[linux_host]['ansible_distribution_version']|default("none")}}</td> <td>{{hostvars[linux_host]['ansible_distribution_version']|default("none")}}</td>
<td> <td>
<ul> <ul>
{% if hostvars[linux_host].patch_linux_patchingresult_yum.changed|default("false",true) == true %} {% if hostvars[linux_host].patchingresult_yum.changed|default("false",true) == true %}
{% for packagename in hostvars[linux_host].patch_linux_patchingresult_yum.changes.updated|sort %} {% for packagename in hostvars[linux_host].patchingresult_yum.changes.updated|sort %}
<li> {{ packagename[0] }} - {{ packagename[1] }} </li> <li> {{ packagename[0] }} - {{ packagename[1] }} </li>
{% endfor %} {% endfor %}
{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed|default("false",true) == true %} {% elif hostvars[linux_host].patchingresult_dnf.changed|default("false",true) == true %}
{% for packagename in hostvars[linux_host].patch_linux_patchingresult_dnf.results|sort %} {% for packagename in hostvars[linux_host].patchingresult_dnf.results|sort %}
<li> {{ packagename }} </li> <li> {{ packagename }} </li>
{% endfor %} {% endfor %}
{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed is undefined %} {% elif hostvars[linux_host].patchingresult_dnf.changed is undefined %}
<li> Patching Failed </li> <li> Patching Failed </li>
{% elif hostvars[linux_host].patch_linux_patchingresult_yum.changed is undefined %} {% elif hostvars[linux_host].patchingresult_yum.changed is undefined %}
<li> Patching Failed </li> <li> Patching Failed </li>
{% else %} {% else %}
<li> Compliant </li> <li> Compliant </li>

View File

@@ -13,10 +13,10 @@
state: present state: present
namespace: patching-report namespace: patching-report
definition: "{{ lookup('ansible.builtin.template', 'resources.yaml.j2') }}" definition: "{{ lookup('ansible.builtin.template', 'resources.yaml.j2') }}"
register: report_ocp_patching_resources_output register: resources_output
- name: Display link to patching report - name: Display link to patching report
ansible.builtin.debug: ansible.builtin.debug:
msg: msg:
- "Patching report availbable at:" - "Patching report availbable at:"
- "{{ report_ocp_patching_resources_output.result.results[3].result.spec.port.targetPort }}://{{ report_ocp_patching_resources_output.result.results[3].result.spec.host }}" - "{{ resources_output.result.results[3].result.spec.port.targetPort }}://{{ resources_output.result.results[3].result.spec.host }}"

View File

@@ -35,17 +35,17 @@
<td>{{hostvars[linux_host]['ansible_distribution_version']|default("none")}}</td> <td>{{hostvars[linux_host]['ansible_distribution_version']|default("none")}}</td>
<td> <td>
<ul> <ul>
{% if hostvars[linux_host].patch_linux_patchingresult_yum.changed|default("false",true) == true %} {% if hostvars[linux_host].patchingresult_yum.changed|default("false",true) == true %}
{% for packagename in hostvars[linux_host].patch_linux_patchingresult_yum.changes.updated|sort %} {% for packagename in hostvars[linux_host].patchingresult_yum.changes.updated|sort %}
<li> {{ packagename[0] }} - {{ packagename[1] }} </li> <li> {{ packagename[0] }} - {{ packagename[1] }} </li>
{% endfor %} {% endfor %}
{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed|default("false",true) == true %} {% elif hostvars[linux_host].patchingresult_dnf.changed|default("false",true) == true %}
{% for packagename in hostvars[linux_host].patch_linux_patchingresult_dnf.results|sort %} {% for packagename in hostvars[linux_host].patchingresult_dnf.results|sort %}
<li> {{ packagename }} </li> <li> {{ packagename }} </li>
{% endfor %} {% endfor %}
{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed is undefined %} {% elif hostvars[linux_host].patchingresult_dnf.changed is undefined %}
<li> Patching Failed </li> <li> Patching Failed </li>
{% elif hostvars[linux_host].patch_linux_patchingresult_yum.changed is undefined %} {% elif hostvars[linux_host].patchingresult_yum.changed is undefined %}
<li> Patching Failed </li> <li> Patching Failed </li>
{% else %} {% else %}
<li> Compliant </li> <li> Compliant </li>

View File

@@ -3,7 +3,7 @@
ansible.builtin.include_vars: "{{ ansible_system }}.yml" ansible.builtin.include_vars: "{{ ansible_system }}.yml"
- name: Install httpd package - name: Install httpd package
ansible.builtin.dnf: ansible.builtin.yum:
name: httpd name: httpd
state: installed state: installed
check_mode: false check_mode: false

View File

@@ -6,7 +6,7 @@
ansible.builtin.find: ansible.builtin.find:
paths: "{{ doc_root }}/{{ reports_dir }}" paths: "{{ doc_root }}/{{ reports_dir }}"
patterns: '*.html' patterns: '*.html'
register: report_server_reports register: reports
check_mode: false check_mode: false
- name: Publish landing page - name: Publish landing page

View File

@@ -6,7 +6,7 @@
ansible.windows.win_find: ansible.windows.win_find:
paths: "{{ doc_root }}/{{ reports_dir }}" paths: "{{ doc_root }}/{{ reports_dir }}"
patterns: '*.html' patterns: '*.html'
register: report_server_reports register: reports
check_mode: false check_mode: false
- name: Publish landing page - name: Publish landing page

View File

@@ -20,7 +20,7 @@
</center> </center>
<table class="table table-striped mt32 main_net_table"> <table class="table table-striped mt32 main_net_table">
<tbody> <tbody>
{% for report in report_server_reports.files %} {% for report in reports.files %}
{% set page = report.path.split('/')[-1] %} {% set page = report.path.split('/')[-1] %}
<tr> <tr>
<td class="summary_info"> <td class="summary_info">

View File

@@ -20,7 +20,7 @@
</center> </center>
<table class="table table-striped mt32 main_net_table"> <table class="table table-striped mt32 main_net_table">
<tbody> <tbody>
{% for report in report_server_reports.files %} {% for report in reports.files %}
{% set page = report.path.split('\\')[-1] %} {% set page = report.path.split('\\')[-1] %}
<tr> <tr>
<td class="summary_info"> <td class="summary_info">

View File

@@ -10,7 +10,7 @@
name: "{{ instance_name }}" name: "{{ instance_name }}"
- name: Remove rhui client packages - name: Remove rhui client packages
ansible.builtin.dnf: ansible.builtin.yum:
name: name:
- google-rhui-client* - google-rhui-client*
- rh-amazon-rhui-client* - rh-amazon-rhui-client*
@@ -19,17 +19,17 @@
- name: Get current repos - name: Get current repos
ansible.builtin.command: ansible.builtin.command:
cmd: ls /etc/yum.repos.d/ cmd: ls /etc/yum.repos.d/
register: register_host_repos register: repos
changed_when: false changed_when: false
- name: Remove existing rhui repos - name: Remove existing rhui repos
ansible.builtin.file: ansible.builtin.file:
path: "/etc/yum.repos.d/{{ item }}" path: "/etc/yum.repos.d/{{ item }}"
state: absent state: absent
loop: "{{ register_host_repos.stdout_lines }}" loop: "{{ repos.stdout_lines }}"
- name: Install satellite certificate - name: Install satellite certificate
ansible.builtin.dnf: ansible.builtin.yum:
name: "{{ satellite_url }}/pub/katello-ca-consumer-latest.noarch.rpm" name: "{{ satellite_url }}/pub/katello-ca-consumer-latest.noarch.rpm"
state: present state: present
validate_certs: false validate_certs: false
@@ -53,7 +53,7 @@
state: enabled state: enabled
- name: Install satellite client - name: Install satellite client
ansible.builtin.dnf: ansible.builtin.yum:
name: name:
- katello-host-tools - katello-host-tools
- katello-host-tools-tracer - katello-host-tools-tracer

View File

@@ -1,6 +1,6 @@
--- ---
- name: Install openscap client packages - name: Install openscap client packages
ansible.builtin.dnf: ansible.builtin.yum:
name: name:
- openscap-scanner - openscap-scanner
- rubygem-foreman_scap_client - rubygem-foreman_scap_client
@@ -15,18 +15,18 @@
force_basic_auth: true force_basic_auth: true
body_format: json body_format: json
validate_certs: false validate_certs: false
register: scap_client_policies register: policies
no_log: "{{ foreman_operations_scap_client_secure_logging }}" no_log: "{{ foreman_operations_scap_client_secure_logging }}"
- name: Build policy {{ policy_name }} - name: Build policy {{ policy_name }}
ansible.builtin.set_fact: ansible.builtin.set_fact:
scap_client_policy: "{{ scap_client_policy | default([]) }} + {{ [item] }}" policy: "{{ policy | default([]) }} + {{ [item] }}"
loop: "{{ scap_client_policies.json.results }}" loop: "{{ policies.json.results }}"
when: item.name in policy_name or policy_name == 'all' when: item.name in policy_name or policy_name == 'all'
- name: Fail if no policy found with required name - name: Fail if no policy found with required name
ansible.builtin.fail: ansible.builtin.fail:
when: scap_client_policy is not defined when: policy is not defined
- name: Get scap content information - name: Get scap content information
ansible.builtin.uri: ansible.builtin.uri:
@@ -37,8 +37,8 @@
force_basic_auth: false force_basic_auth: false
body_format: json body_format: json
validate_certs: false validate_certs: false
register: scap_client_scapcontents register: scapcontents
loop: "{{ scap_client_policy }}" loop: "{{ policy }}"
no_log: "{{ foreman_operations_scap_client_secure_logging }}" no_log: "{{ foreman_operations_scap_client_secure_logging }}"
- name: Get tailoring content information - name: Get tailoring content information
@@ -50,21 +50,21 @@
force_basic_auth: false force_basic_auth: false
body_format: json body_format: json
validate_certs: false validate_certs: false
register: scap_client_tailoringfiles register: tailoringfiles
when: item.tailoring_file_id | int > 0 | d(False) when: item.tailoring_file_id | int > 0 | d(False)
loop: "{{ scap_client_policy }}" loop: "{{ policy }}"
no_log: "{{ foreman_operations_scap_client_secure_logging }}" no_log: "{{ foreman_operations_scap_client_secure_logging }}"
- name: Build scap content parameters - name: Build scap content parameters
ansible.builtin.set_fact: ansible.builtin.set_fact:
scap_client_scap_content: "{{ scap_client_scap_content | default({}) | combine({item.json.id: item.json}) }}" scap_content: "{{ scap_content | default({}) | combine({item.json.id: item.json}) }}"
loop: "{{ scap_client_scapcontents.results }}" loop: "{{ scapcontents.results }}"
- name: Build tailoring content parameters - name: Build tailoring content parameters
ansible.builtin.set_fact: ansible.builtin.set_fact:
scap_client_tailoring_files: "{{ scap_client_tailoring_files | default({}) | combine({item.json.id: item.json}) }}" tailoring_files: "{{ tailoring_files | default({}) | combine({item.json.id: item.json}) }}"
when: item.json is defined when: item.json is defined
loop: "{{ scap_client_tailoringfiles.results }}" loop: "{{ tailoringfiles.results }}"
- name: Apply openscap client configuration template - name: Apply openscap client configuration template
ansible.builtin.template: ansible.builtin.template:
@@ -78,7 +78,7 @@
# cron: # cron:
# name: "Openscap Execution" # name: "Openscap Execution"
# cron_file: 'foreman_openscap_client' # cron_file: 'foreman_openscap_client'
# job: '/usr/bin/foreman_scap_client {{scap_client_policy.id}} > /dev/null' # job: '/usr/bin/foreman_scap_client {{policy.id}} > /dev/null'
# weekday: "{{crontab_weekdays}}" # weekday: "{{crontab_weekdays}}"
# hour: "{{crontab_hour}}" # hour: "{{crontab_hour}}"
# minute: "{{crontab_minute}}" # minute: "{{crontab_minute}}"

View File

@@ -20,12 +20,12 @@
# Install subscription-manager if it's not there # Install subscription-manager if it's not there
- name: Install subscription-manager - name: Install subscription-manager
ansible.builtin.dnf: ansible.builtin.yum:
name: subscription-manager name: subscription-manager
state: present state: present
- name: Remove rhui client packages - name: Remove rhui client packages
ansible.builtin.dnf: ansible.builtin.yum:
name: rh-amazon-rhui-client* name: rh-amazon-rhui-client*
state: removed state: removed
@@ -43,7 +43,7 @@
when: "'rhui' in item" when: "'rhui' in item"
- name: Install katello package - name: Install katello package
ansible.builtin.dnf: ansible.builtin.yum:
name: "https://{{ sat_url }}/pub/katello-ca-consumer-latest.noarch.rpm" name: "https://{{ sat_url }}/pub/katello-ca-consumer-latest.noarch.rpm"
state: present state: present
validate_certs: false validate_certs: false

View File

@@ -8,7 +8,7 @@
tasks: tasks:
# Install yum-utils if it's not there # Install yum-utils if it's not there
- name: Install yum-utils - name: Install yum-utils
ansible.builtin.dnf: ansible.builtin.yum:
name: yum-utils name: yum-utils
state: installed state: installed
check_mode: false check_mode: false

View File

@@ -16,7 +16,7 @@
key: "{{ sudo_user }}" key: "{{ sudo_user }}"
- name: Check Cleanup package - name: Check Cleanup package
ansible.builtin.dnf: ansible.builtin.yum:
name: at name: at
state: present state: present

View File

@@ -5,7 +5,7 @@
tasks: tasks:
# Install yum-utils if it's not there # Install yum-utils if it's not there
- name: Install yum-utils - name: Install yum-utils
ansible.builtin.dnf: ansible.builtin.yum:
name: yum-utils name: yum-utils
state: installed state: installed

View File

@@ -245,6 +245,34 @@ controller_templates:
- "OpenShift Credential" - "OpenShift Credential"
controller_workflows: controller_workflows:
- name: OpenShift / CNV / Sync Hosts
description: A workflow to update dynamic CNV inventory and wait for hosts to become avilable
organization: Default
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
survey_enabled: true
survey:
name: ''
description: ''
spec:
- question_name: Specify target hosts
type: text
variable: _hosts
required: true
default: "openshift-cnv-rhel*"
simplified_workflow_nodes:
- identifier: Inventory Sync
unified_job_template: OpenShift CNV Inventory
success_nodes:
- Wait Hosts
- identifier: Wait Hosts
unified_job_template: OpenShift / CNV / Wait Hosts
failure_nodes:
- Second Inventory Sync
- identifier: Second Inventory Sync
unified_job_template: OpenShift CNV Inventory
- name: OpenShift / CNV / Infra Stack - name: OpenShift / CNV / Infra Stack
description: A workflow to deploy Virtualized infra in OCP Virtalization description: A workflow to deploy Virtualized infra in OCP Virtalization
organization: Default organization: Default
@@ -320,15 +348,15 @@ controller_workflows:
success_nodes: success_nodes:
- Patch Instance - Patch Instance
# We need to do an invnetory sync *after* creating snapshots, as turning VMs on/off changes their IP # We need to do an invnetory sync *after* creating snapshots, as turning VMs on/off changes their IP
- identifier: Inventory Sync - identifier: Sync Hosts
unified_job_template: OpenShift CNV Inventory unified_job_template: OpenShift / CNV / Sync Hosts
success_nodes: success_nodes:
- Patch Instance - Patch Instance
- identifier: Take Snapshot - identifier: Take Snapshot
unified_job_template: OpenShift / CNV / Create VM Snapshots unified_job_template: OpenShift / CNV / Create VM Snapshots
success_nodes: success_nodes:
- Project Sync - Project Sync
- Inventory Sync - Sync Hosts
- identifier: Patch Instance - identifier: Patch Instance
unified_job_template: OpenShift / CNV / Patch unified_job_template: OpenShift / CNV / Patch
job_type: run job_type: run

View File

@@ -8,8 +8,6 @@
- [Jobs](#jobs) - [Jobs](#jobs)
- [Workflows](#workflows) - [Workflows](#workflows)
- [Suggested Usage](#suggested-usage) - [Suggested Usage](#suggested-usage)
- [Connecting to Windows Hosts](#connecting-to-windows-hosts)
- [Testing with RDP](#testing-with-rdp)
## About These Demos ## About These Demos
This category of demos shows examples of Windows Server operations and management with Ansible Automation Platform. The list of demos can be found below. See the [Suggested Usage](#suggested-usage) section of this document for recommendations on how to best use these demos. This category of demos shows examples of Windows Server operations and management with Ansible Automation Platform. The list of demos can be found below. See the [Suggested Usage](#suggested-usage) section of this document for recommendations on how to best use these demos.
@@ -42,24 +40,3 @@ We are currently investigating an intermittent connectivity issue related to the
**WINDOWS / Helpdesk new user portal** - This job is dependant on the Create Active Directory Domain completing before users can be created. **WINDOWS / Helpdesk new user portal** - This job is dependant on the Create Active Directory Domain completing before users can be created.
**WINDOWS / Join Active Directory Domain** - This job is dependant on the Create Active Directory Domain completing before computers can be joined. **WINDOWS / Join Active Directory Domain** - This job is dependant on the Create Active Directory Domain completing before computers can be joined.
## Connecting to Windows Hosts
The provided template for provisioning VMs in AWS supports a few blueprints, notably [windows_core](../cloud/blueprints/windows_core.yml) and [windows_full](../cloud/blueprints/windows_full.yml). The windows blueprints both rely on the [aws_windows_userdata](../collections/ansible_collections/demo/cloud/roles/aws/templates/aws_windows_userdata.j2) script which configures a user with Administrator privileges. By default, the Demo Credential is used to inject a password for `ec2-user`.
⚠️ When using Ansible Product Demos on demo.redhat.com,<br>
the image below demonstrates where you can locate the Demo Credential password:<br>
![Windows VM Password](../.github/images/windows_vm_password.png)
### Testing with RDP
In the AWS Console, you can follow the steps below to download an RDP configuration for your Windows host:
1. Navigate to the EC2 Dashboard
2. Navigate to Instances
3. Click on the desired Instance ID
4. Click the button to **Connect**
5. Select the **RDP client** tab
6. Click the button to **Download remote desktop file**
7. Use a local RDP client to open the file and connect<br>
_Note: the configuration will default to using Administrator as the username, replace with ec2-user_