Skip to content

check if .bashrc exists before trying to disable ocenv #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/bashrc_check_fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "oradb_manage_db: check if .bashrc exists before trying to disable ocenv"
6 changes: 6 additions & 0 deletions roles/oradb_manage_db/tasks/ocenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
group: "{{ oracle_group }}"
mode: '0644'

- name: manage_db | Check if .bashrc exists
ansible.builtin.stat:
path: "{{ oracle_user_home }}/.bashrc"
register: bashrc_status

# OUI in RAC mode has issues with echo in '.bashrc'
# Move the echo to .bash_profile
# This task should be removed in a later Release of ansible-oracle
Expand All @@ -27,6 +32,7 @@
marker: "# {mark} ocenv ANSIBLE MANAGED BLOCK"
backup: false
state: absent
when: bashrc_status.stat.exists

- name: manage_db | add ocenv to .bash_profile # noqa: args[module]
ansible.builtin.blockinfile:
Expand Down
Loading