Skip to content

Commit db3abc8

Browse files
talekRendanic
authored andcommitted
check if .bashrc exists before trying to disable ocenv
1 parent e09f644 commit db3abc8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
bugfixes:
3+
- "oradb_manage_db: check if .bashrc exists before trying to disable ocenv"

roles/oradb_manage_db/tasks/ocenv.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
group: "{{ oracle_group }}"
1919
mode: '0644'
2020

21+
- name: manage_db | Check if .bashrc exists
22+
ansible.builtin.stat:
23+
path: "{{ oracle_user_home }}/.bashrc"
24+
register: bashrc_status
25+
2126
# OUI in RAC mode has issues with echo in '.bashrc'
2227
# Move the echo to .bash_profile
2328
# This task should be removed in a later Release of ansible-oracle
@@ -27,6 +32,7 @@
2732
marker: "# {mark} ocenv ANSIBLE MANAGED BLOCK"
2833
backup: false
2934
state: absent
35+
when: bashrc_status.stat.exists
3036

3137
- name: manage_db | add ocenv to .bash_profile # noqa: args[module]
3238
ansible.builtin.blockinfile:

0 commit comments

Comments
 (0)