Skip to content

Commit 125ba62

Browse files
talekRendanic
authored andcommitted
oradb_manage_db: customize ocenv init in bashrc
1 parent 385b1f9 commit 125ba62

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- "oradb_manage_db: customize ocenv initialization in bashrc"

roles/oradb_manage_db/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,7 @@ shell_aliases:
144144
- "lsnrservice='lsnrctl services $LSNRNAME'"
145145

146146
deploy_ocenv: true # deploy ocenv scripts
147+
ocenv_bashrc_init: true
148+
ocenv_bashrc_init_section: |
149+
echo "execute ocenv to source Oracle Environment"
150+
alias ocenv='. "{{ dbenvdir }}/ocenv"'

roles/oradb_manage_db/tasks/ocenv.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
ansible.builtin.blockinfile:
2323
path: "{{ oracle_user_home }}/.bashrc"
2424
marker: "# {mark} ocenv ANSIBLE MANAGED BLOCK"
25-
block: |
26-
echo "execute ocenv to source Oracle Environment"
27-
alias ocenv='. "{{ dbenvdir }}/ocenv"'
25+
block: "{{ ocenv_bashrc_init_section }}"
2826
create: true
2927
owner: "{{ oracle_user }}"
3028
group: "{{ oracle_group }}"
3129
mode: 0644
30+
state: "{{ 'present' if ocenv_bashrc_init else 'absent' }}"

0 commit comments

Comments
 (0)