diff --git a/collections/ansible_collections/demo/cloud/roles/aws/tasks/restore_vm.yml b/collections/ansible_collections/demo/cloud/roles/aws/tasks/restore_vm.yml
index a36f6a6..8be5338 100644
--- a/collections/ansible_collections/demo/cloud/roles/aws/tasks/restore_vm.yml
+++ b/collections/ansible_collections/demo/cloud/roles/aws/tasks/restore_vm.yml
@@ -40,7 +40,7 @@
- name: AWS | RESTORE VM | get all snapshots
when: inventory_hostname not in aws_snapshots
- register: r_snapshots
+ register: aws_r_snapshots
amazon.aws.ec2_snapshot_info:
region: "{{ aws_region }}"
filters:
@@ -51,7 +51,7 @@
amazon.aws.ec2_vol:
region: "{{ aws_region }}"
instance: "{{ instance_id }}"
- snapshot: "{{ r_snapshots.snapshots[0].snapshot_id }}"
+ snapshot: "{{ aws_r_snapshots.snapshots[0].snapshot_id }}"
device_name: "/dev/sda1"
- name: AWS | RESTORE VM | start vm
diff --git a/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/restore.yml b/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/restore.yml
index a30b964..8bb7329 100644
--- a/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/restore.yml
+++ b/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/restore.yml
@@ -3,18 +3,18 @@
redhat.openshift_virtualization.kubevirt_vm_info:
name: "{{ item }}"
namespace: "{{ vm_namespace }}"
- register: state
+ register: snapshot_state
- name: List snapshots
kubernetes.core.k8s_info:
api_version: snapshot.kubevirt.io/v1alpha1
kind: VirtualMachineSnapshot
namespace: "{{ vm_namespace }}"
- register: snapshot
+ register: snapshot_snapshot
- name: Set snapshot name for {{ item }}
ansible.builtin.set_fact:
- latest_snapshot: "{{ snapshot.resources | selectattr('spec.source.name', 'equalto', item) | sort(attribute='metadata.creationTimestamp') | first }}"
+ snapshot_latest_snapshot: "{{ snapshot_snapshot.resources | selectattr('spec.source.name', 'equalto', item) | sort(attribute='metadata.creationTimestamp') | first }}"
- name: Stop VirtualMachine
redhat.openshift_virtualization.kubevirt_vm:
@@ -22,7 +22,7 @@
namespace: "{{ vm_namespace }}"
running: false
wait: true
- when: state.resources.0.spec.running
+ when: snapshot_state.resources.0.spec.running
- name: Restore a VirtualMachineSnapshot
kubernetes.core.k8s:
@@ -30,14 +30,14 @@
apiVersion: snapshot.kubevirt.io/v1alpha1
kind: VirtualMachineRestore
metadata:
- generateName: "{{ latest_snapshot.metadata.generateName }}"
+ generateName: "{{ snapshot_latest_snapshot.metadata.generateName }}"
namespace: "{{ vm_namespace }}"
spec:
target:
apiGroup: kubevirt.io
kind: VirtualMachine
name: "{{ item }}"
- virtualMachineSnapshotName: "{{ latest_snapshot.metadata.name }}"
+ virtualMachineSnapshotName: "{{ snapshot_latest_snapshot.metadata.name }}"
wait: true
wait_condition:
type: Ready
@@ -48,4 +48,4 @@
namespace: "{{ vm_namespace }}"
running: true
wait: true
- when: state.resources.0.spec.running
+ when: snapshot_state.resources.0.spec.running
diff --git a/collections/ansible_collections/demo/patching/roles/patch_linux/tasks/main.yml b/collections/ansible_collections/demo/patching/roles/patch_linux/tasks/main.yml
index d1722f0..a898785 100644
--- a/collections/ansible_collections/demo/patching/roles/patch_linux/tasks/main.yml
+++ b/collections/ansible_collections/demo/patching/roles/patch_linux/tasks/main.yml
@@ -13,7 +13,7 @@
state: latest # noqa: package-latest - Intended to update packages to latest
exclude: "{{ exclude_packages }}"
when: ansible_pkg_mgr == "yum"
- register: patchingresult_yum
+ register: patch_linux_patchingresult_yum
- name: Upgrade packages (dnf)
ansible.builtin.dnf:
@@ -21,7 +21,7 @@
state: latest # noqa: package-latest - Intended to update packages to latest
exclude: "{{ exclude_packages }}"
when: ansible_pkg_mgr == "dnf"
- register: patchingresult_dnf
+ register: patch_linux_patchingresult_dnf
- name: Check to see if we need a reboot
ansible.builtin.command: needs-restarting -r
diff --git a/collections/ansible_collections/demo/patching/roles/patch_windows/tasks/main.yml b/collections/ansible_collections/demo/patching/roles/patch_windows/tasks/main.yml
index 429340e..3dc4e91 100644
--- a/collections/ansible_collections/demo/patching/roles/patch_windows/tasks/main.yml
+++ b/collections/ansible_collections/demo/patching/roles/patch_windows/tasks/main.yml
@@ -12,4 +12,4 @@
category_names: "{{ win_update_categories | default(omit) }}"
reboot: "{{ allow_reboot }}"
state: installed
- register: patchingresult
+ register: patch_windows_patchingresult
diff --git a/collections/ansible_collections/demo/patching/roles/report_linux_patching/templates/report.j2 b/collections/ansible_collections/demo/patching/roles/report_linux_patching/templates/report.j2
index 1d7a840..172f44e 100644
--- a/collections/ansible_collections/demo/patching/roles/report_linux_patching/templates/report.j2
+++ b/collections/ansible_collections/demo/patching/roles/report_linux_patching/templates/report.j2
@@ -35,17 +35,17 @@
{{hostvars[linux_host]['ansible_distribution_version']|default("none")}} |
-{% if hostvars[linux_host].patchingresult_yum.changed|default("false",true) == true %}
-{% for packagename in hostvars[linux_host].patchingresult_yum.changes.updated|sort %}
+{% if hostvars[linux_host].patch_linux_patchingresult_yum.changed|default("false",true) == true %}
+{% for packagename in hostvars[linux_host].patch_linux_patchingresult_yum.changes.updated|sort %}
- {{ packagename[0] }} - {{ packagename[1] }}
{% endfor %}
-{% elif hostvars[linux_host].patchingresult_dnf.changed|default("false",true) == true %}
-{% for packagename in hostvars[linux_host].patchingresult_dnf.results|sort %}
+{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed|default("false",true) == true %}
+{% for packagename in hostvars[linux_host].patch_linux_patchingresult_dnf.results|sort %}
- {{ packagename }}
{% endfor %}
-{% elif hostvars[linux_host].patchingresult_dnf.changed is undefined %}
+{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed is undefined %}
- Patching Failed
-{% elif hostvars[linux_host].patchingresult_yum.changed is undefined %}
+{% elif hostvars[linux_host].patch_linux_patchingresult_yum.changed is undefined %}
- Patching Failed
{% else %}
- Compliant
diff --git a/collections/ansible_collections/demo/patching/roles/report_ocp_patching/tasks/main.yml b/collections/ansible_collections/demo/patching/roles/report_ocp_patching/tasks/main.yml
index 1e524f3..7e9eab2 100644
--- a/collections/ansible_collections/demo/patching/roles/report_ocp_patching/tasks/main.yml
+++ b/collections/ansible_collections/demo/patching/roles/report_ocp_patching/tasks/main.yml
@@ -13,10 +13,10 @@
state: present
namespace: patching-report
definition: "{{ lookup('ansible.builtin.template', 'resources.yaml.j2') }}"
- register: resources_output
+ register: report_ocp_patching_resources_output
- name: Display link to patching report
ansible.builtin.debug:
msg:
- "Patching report availbable at:"
- - "{{ resources_output.result.results[3].result.spec.port.targetPort }}://{{ resources_output.result.results[3].result.spec.host }}"
+ - "{{ report_ocp_patching_resources_output.result.results[3].result.spec.port.targetPort }}://{{ report_ocp_patching_resources_output.result.results[3].result.spec.host }}"
diff --git a/collections/ansible_collections/demo/patching/roles/report_ocp_patching/templates/patch.j2 b/collections/ansible_collections/demo/patching/roles/report_ocp_patching/templates/patch.j2
index 1d7a840..172f44e 100644
--- a/collections/ansible_collections/demo/patching/roles/report_ocp_patching/templates/patch.j2
+++ b/collections/ansible_collections/demo/patching/roles/report_ocp_patching/templates/patch.j2
@@ -35,17 +35,17 @@
{{hostvars[linux_host]['ansible_distribution_version']|default("none")}} |
-{% if hostvars[linux_host].patchingresult_yum.changed|default("false",true) == true %}
-{% for packagename in hostvars[linux_host].patchingresult_yum.changes.updated|sort %}
+{% if hostvars[linux_host].patch_linux_patchingresult_yum.changed|default("false",true) == true %}
+{% for packagename in hostvars[linux_host].patch_linux_patchingresult_yum.changes.updated|sort %}
- {{ packagename[0] }} - {{ packagename[1] }}
{% endfor %}
-{% elif hostvars[linux_host].patchingresult_dnf.changed|default("false",true) == true %}
-{% for packagename in hostvars[linux_host].patchingresult_dnf.results|sort %}
+{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed|default("false",true) == true %}
+{% for packagename in hostvars[linux_host].patch_linux_patchingresult_dnf.results|sort %}
- {{ packagename }}
{% endfor %}
-{% elif hostvars[linux_host].patchingresult_dnf.changed is undefined %}
+{% elif hostvars[linux_host].patch_linux_patchingresult_dnf.changed is undefined %}
- Patching Failed
-{% elif hostvars[linux_host].patchingresult_yum.changed is undefined %}
+{% elif hostvars[linux_host].patch_linux_patchingresult_yum.changed is undefined %}
- Patching Failed
{% else %}
- Compliant
diff --git a/collections/ansible_collections/demo/patching/roles/report_server/tasks/apache.yml b/collections/ansible_collections/demo/patching/roles/report_server/tasks/apache.yml
index 6fc8287..3b0784b 100644
--- a/collections/ansible_collections/demo/patching/roles/report_server/tasks/apache.yml
+++ b/collections/ansible_collections/demo/patching/roles/report_server/tasks/apache.yml
@@ -3,7 +3,7 @@
ansible.builtin.include_vars: "{{ ansible_system }}.yml"
- name: Install httpd package
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: httpd
state: installed
check_mode: false
diff --git a/collections/ansible_collections/demo/patching/roles/report_server/tasks/linux_landing_page.yml b/collections/ansible_collections/demo/patching/roles/report_server/tasks/linux_landing_page.yml
index 668609e..5077eae 100644
--- a/collections/ansible_collections/demo/patching/roles/report_server/tasks/linux_landing_page.yml
+++ b/collections/ansible_collections/demo/patching/roles/report_server/tasks/linux_landing_page.yml
@@ -6,7 +6,7 @@
ansible.builtin.find:
paths: "{{ doc_root }}/{{ reports_dir }}"
patterns: '*.html'
- register: reports
+ register: report_server_reports
check_mode: false
- name: Publish landing page
diff --git a/collections/ansible_collections/demo/patching/roles/report_server/tasks/windows_landing_page.yml b/collections/ansible_collections/demo/patching/roles/report_server/tasks/windows_landing_page.yml
index d9faab9..5bac766 100644
--- a/collections/ansible_collections/demo/patching/roles/report_server/tasks/windows_landing_page.yml
+++ b/collections/ansible_collections/demo/patching/roles/report_server/tasks/windows_landing_page.yml
@@ -6,7 +6,7 @@
ansible.windows.win_find:
paths: "{{ doc_root }}/{{ reports_dir }}"
patterns: '*.html'
- register: reports
+ register: report_server_reports
check_mode: false
- name: Publish landing page
diff --git a/collections/ansible_collections/demo/patching/roles/report_server/templates/linux_report.j2 b/collections/ansible_collections/demo/patching/roles/report_server/templates/linux_report.j2
index 9d60470..0a19e01 100644
--- a/collections/ansible_collections/demo/patching/roles/report_server/templates/linux_report.j2
+++ b/collections/ansible_collections/demo/patching/roles/report_server/templates/linux_report.j2
@@ -20,7 +20,7 @@
-{% for report in reports.files %}
+{% for report in report_server_reports.files %}
{% set page = report.path.split('/')[-1] %}
diff --git a/collections/ansible_collections/demo/patching/roles/report_server/templates/windows_report.j2 b/collections/ansible_collections/demo/patching/roles/report_server/templates/windows_report.j2
index 5feb509..3aa066b 100644
--- a/collections/ansible_collections/demo/patching/roles/report_server/templates/windows_report.j2
+++ b/collections/ansible_collections/demo/patching/roles/report_server/templates/windows_report.j2
@@ -20,7 +20,7 @@
-{% for report in reports.files %}
+{% for report in report_server_reports.files %}
{% set page = report.path.split('\\')[-1] %}
|
diff --git a/collections/ansible_collections/demo/satellite/roles/register_host/tasks/main.yml b/collections/ansible_collections/demo/satellite/roles/register_host/tasks/main.yml
index 05decf0..d90fad2 100644
--- a/collections/ansible_collections/demo/satellite/roles/register_host/tasks/main.yml
+++ b/collections/ansible_collections/demo/satellite/roles/register_host/tasks/main.yml
@@ -10,7 +10,7 @@
name: "{{ instance_name }}"
- name: Remove rhui client packages
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name:
- google-rhui-client*
- rh-amazon-rhui-client*
@@ -19,17 +19,17 @@
- name: Get current repos
ansible.builtin.command:
cmd: ls /etc/yum.repos.d/
- register: repos
+ register: register_host_repos
changed_when: false
- name: Remove existing rhui repos
ansible.builtin.file:
path: "/etc/yum.repos.d/{{ item }}"
state: absent
- loop: "{{ repos.stdout_lines }}"
+ loop: "{{ register_host_repos.stdout_lines }}"
- name: Install satellite certificate
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: "{{ satellite_url }}/pub/katello-ca-consumer-latest.noarch.rpm"
state: present
validate_certs: false
@@ -53,7 +53,7 @@
state: enabled
- name: Install satellite client
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name:
- katello-host-tools
- katello-host-tools-tracer
diff --git a/collections/ansible_collections/demo/satellite/roles/scap_client/tasks/main.yaml b/collections/ansible_collections/demo/satellite/roles/scap_client/tasks/main.yaml
index b9ce9ef..19a33db 100644
--- a/collections/ansible_collections/demo/satellite/roles/scap_client/tasks/main.yaml
+++ b/collections/ansible_collections/demo/satellite/roles/scap_client/tasks/main.yaml
@@ -1,6 +1,6 @@
---
- name: Install openscap client packages
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name:
- openscap-scanner
- rubygem-foreman_scap_client
@@ -15,18 +15,18 @@
force_basic_auth: true
body_format: json
validate_certs: false
- register: policies
+ register: scap_client_policies
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
- name: Build policy {{ policy_name }}
ansible.builtin.set_fact:
policy: "{{ policy | default([]) }} + {{ [item] }}"
- loop: "{{ policies.json.results }}"
+ loop: "{{ scap_client_policies.json.results }}"
when: item.name in policy_name or policy_name == 'all'
- name: Fail if no policy found with required name
ansible.builtin.fail:
- when: policy is not defined
+ when: scap_client_policy is not defined
- name: Get scap content information
ansible.builtin.uri:
@@ -37,8 +37,8 @@
force_basic_auth: false
body_format: json
validate_certs: false
- register: scapcontents
- loop: "{{ policy }}"
+ register: scap_client_scapcontents
+ loop: "{{ scap_client_policy }}"
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
- name: Get tailoring content information
@@ -50,21 +50,21 @@
force_basic_auth: false
body_format: json
validate_certs: false
- register: tailoringfiles
+ register: scap_client_tailoringfiles
when: item.tailoring_file_id | int > 0 | d(False)
- loop: "{{ policy }}"
+ loop: "{{ scap_client_policy }}"
no_log: "{{ foreman_operations_scap_client_secure_logging }}"
- name: Build scap content parameters
ansible.builtin.set_fact:
- scap_content: "{{ scap_content | default({}) | combine({item.json.id: item.json}) }}"
- loop: "{{ scapcontents.results }}"
+ scap_client_scap_content: "{{ scap_client_scap_content | default({}) | combine({item.json.id: item.json}) }}"
+ loop: "{{ scap_client_scapcontents.results }}"
- name: Build tailoring content parameters
ansible.builtin.set_fact:
- tailoring_files: "{{ tailoring_files | default({}) | combine({item.json.id: item.json}) }}"
+ scap_client_tailoring_files: "{{ scap_client_tailoring_files | default({}) | combine({item.json.id: item.json}) }}"
when: item.json is defined
- loop: "{{ tailoringfiles.results }}"
+ loop: "{{ scap_client_tailoringfiles.results }}"
- name: Apply openscap client configuration template
ansible.builtin.template:
@@ -78,7 +78,7 @@
# cron:
# name: "Openscap Execution"
# cron_file: 'foreman_openscap_client'
-# job: '/usr/bin/foreman_scap_client {{policy.id}} > /dev/null'
+# job: '/usr/bin/foreman_scap_client {{scap_client_policy.id}} > /dev/null'
# weekday: "{{crontab_weekdays}}"
# hour: "{{crontab_hour}}"
# minute: "{{crontab_minute}}"
diff --git a/linux/ec2_register.yml b/linux/ec2_register.yml
index 4aba9d3..c0c79b0 100644
--- a/linux/ec2_register.yml
+++ b/linux/ec2_register.yml
@@ -20,12 +20,12 @@
# Install subscription-manager if it's not there
- name: Install subscription-manager
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: subscription-manager
state: present
- name: Remove rhui client packages
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: rh-amazon-rhui-client*
state: removed
@@ -43,7 +43,7 @@
when: "'rhui' in item"
- name: Install katello package
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: "https://{{ sat_url }}/pub/katello-ca-consumer-latest.noarch.rpm"
state: present
validate_certs: false
diff --git a/linux/patching.yml b/linux/patching.yml
index 5cea524..73b5ed8 100644
--- a/linux/patching.yml
+++ b/linux/patching.yml
@@ -8,7 +8,7 @@
tasks:
# Install yum-utils if it's not there
- name: Install yum-utils
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: yum-utils
state: installed
check_mode: false
diff --git a/linux/temp_sudo.yml b/linux/temp_sudo.yml
index 87d2e5d..770c367 100644
--- a/linux/temp_sudo.yml
+++ b/linux/temp_sudo.yml
@@ -16,7 +16,7 @@
key: "{{ sudo_user }}"
- name: Check Cleanup package
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: at
state: present
diff --git a/openshift/cnv/patch.yml b/openshift/cnv/patch.yml
index 6ceeceb..43ae32b 100644
--- a/openshift/cnv/patch.yml
+++ b/openshift/cnv/patch.yml
@@ -5,7 +5,7 @@
tasks:
# Install yum-utils if it's not there
- name: Install yum-utils
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: yum-utils
state: installed
| | | |