Skip to content

Commit

Permalink
fixed typo with the os_path variable accross multiple shell commands (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-vick authored Aug 29, 2023
1 parent d108d90 commit 3e1afc8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion roles/analysis/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# TODO: Having issues with community.general.redhat_subscription and subscription-manager on RHEL 6.
- name: Register to pre leapp activation key RHEL 6
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
subscription-manager register
--org="{{ satellite_organization }}"
--activationkey="{{ satellite_activation_key_pre_leapp }}"
Expand Down
6 changes: 3 additions & 3 deletions roles/analysis/tasks/analysis-preupg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# TODO: Having issues with community.general.redhat_subscription and subscription-manager on RHEL 6.
- name: Register to upgrade activation key
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
subscription-manager register
--org="{{ satellite_organization }}"
--activationkey="{{ satellite_activation_key_pre_leapp }}"
Expand All @@ -17,7 +17,7 @@

- name: Enable requisite RHUI repos
ansible.builtin.shell: |
export PATH={{ os_release }}
export PATH={{ os_path }}
set -o pipefail
yum-config-manager --enable {{ item }}
loop: "{{ analysis_repos_el6 }}"
Expand Down Expand Up @@ -50,7 +50,7 @@

- name: Run preupg
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
set -o pipefail;
preupg --force --text
2>&1 | tee -a {{ log_file }}
Expand Down
2 changes: 1 addition & 1 deletion roles/analysis/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- name: Capture a list of non-rhel versioned packages
ansible.builtin.shell:
cmd: >-
export PATH={{ os_release }};
export PATH={{ os_path }};
set -o pipefail;
rpm -qa | grep -ve '[\.|+]el{{ ansible_distribution_major_version }}' |
grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' |
Expand Down
2 changes: 1 addition & 1 deletion roles/common/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- name: Rename log file
ansible.builtin.shell: |
export PATH={{ os_release }}
export PATH={{ os_path }}
mv {{ log_file }} {{ log_file }}-{{ ansible_date_time.iso8601_basic_short }}
listen: Archive log file
...
2 changes: 1 addition & 1 deletion roles/upgrade/tasks/check-for-old-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: Search for old packages and packages not versioned by rhel release
ansible.builtin.shell:
cmd: >-
export PATH={{ os_release }};
export PATH={{ os_path }};
set -o pipefail;
rpm -qa |
grep -ve '[\.|+]el{{ ansible_distribution_major_version }}' |
Expand Down
4 changes: 2 additions & 2 deletions roles/upgrade/tasks/grub2-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@

- name: Run grub2-install
ansible.builtin.shell: |
export PATH={{ os_release }}
export PATH={{ os_path }}
grub2-install {{ grub_boot_device }}
- name: Run grub2-mkconfig
ansible.builtin.shell: |
export PATH={{ os_release }}
export PATH={{ os_path }}
set -o pipefail
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Expand Down
2 changes: 1 addition & 1 deletion roles/upgrade/tasks/leapp-post-upgrade-selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# TODO: Relocate to validation and compare to previous selinux state.
# - name: Ensure there are no SELinux denials
# ansible.builtin.shell: >
# export PATH={{ os_release }};
# export PATH={{ os_path }};
# ausearch -m AVC,USER_AVC -ts boot 2>&1
# register: ausearch_results
# changed_when: false
Expand Down
10 changes: 5 additions & 5 deletions roles/upgrade/tasks/leapp-post-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# /etc/dnf/dnf.conf is an ini file and could be parsed to check if exclude has value and run this conditionally.
- name: Clean dnf exclude list
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
dnf config-manager --save --setopt exclude=''
# leapp 7 to 8 documentation cleans up old kernels
Expand All @@ -19,15 +19,15 @@

- name: Remove weak modules from old kernels
ansible.builtin.shell: |
export PATH={{ os_release }}
export PATH={{ os_path }}
set -o pipefail
[ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-kernel {{ item.path | basename }}
loop: "{{ old_kernels.files }}"
failed_when: false

- name: Remove the old kernels from the boot loader entry
ansible.builtin.shell: |
export PATH={{ os_release }}
export PATH={{ os_path }}
set -o pipefail
/bin/kernel-install remove {{ item.path | basename }} {{ item.path }}/vmlinuz
loop: "{{ old_kernels.files }}"
Expand Down Expand Up @@ -59,7 +59,7 @@

- name: Unset subscription-manager release
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
subscription-manager release --unset
when: leapp_upgrade_type == 'satellite' or leapp_upgrade_type == 'cdn'

Expand All @@ -84,7 +84,7 @@
# Only found in RHEL 7 to 8 documentation
- name: Old kernels have been removed from the bootloader entry for RHEL 7 to 8
ansible.builtin.shell: |
export PATH={{ os_release }}
export PATH={{ os_path }}
grubby --info=ALL | grep "\.el7" || echo "Old kernels are not present in the bootloader."
register: grubby_check
when: ansible_facts.ansible_local.pre_ripu.distribution_major_version | int == 7
Expand Down
4 changes: 2 additions & 2 deletions roles/upgrade/tasks/leapp-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

- name: Start Leapp OS upgrade
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
set -o pipefail;
leapp upgrade
{{ leapp_upgrade_opts }}
Expand Down Expand Up @@ -63,7 +63,7 @@
block:
- name: Run grub2-install
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
grub2-install {{ grub_boot_device }}
- name: Reboot to pickup grub update
Expand Down
6 changes: 3 additions & 3 deletions roles/upgrade/tasks/redhat-upgrade-tool-upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Run preupg --riskcheck
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
preupg --riskcheck
register: preupg
changed_when: false
Expand All @@ -15,7 +15,7 @@
# TODO: Having issues with community.general.redhat_subscription and subscription-manager on RHEL 6.
- name: Register to leapp activation key
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
subscription-manager register
--org_id: "{{ satellite_organization }}"
activationkey: "{{ satellite_activation_key_leapp }}"
Expand Down Expand Up @@ -51,7 +51,7 @@
# --cleanup-post removes Red Hat signed RHEL 6 packages and in theory should be safe.
- name: Run redhat-upgrade-tool
ansible.builtin.shell: >
export PATH={{ os_release }};
export PATH={{ os_path }};
set -o pipefail;
redhat-upgrade-tool --network 7.9 --instrepo {{ rhel_7_network_install_repo_url }} --force --cleanup-post
2>&1 | tee -a {{ log_file }}
Expand Down

0 comments on commit 3e1afc8

Please sign in to comment.