-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpush_profile.yaml
More file actions
25 lines (22 loc) · 872 Bytes
/
Copy pathpush_profile.yaml
File metadata and controls
25 lines (22 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
- name: Profile playbook
hosts: all
tasks:
- name: register the remote username
become: false
command: whoami
changed_when: false
register: whoami
- name: Add line to .bash_profile to run user-specific profile if found
lineinfile:
create: yes
path: /home/{{ whoami.stdout }}/.bash_profile
line: '[[ -f ~/$LOGNAME.profile ]] && . ~/$LOGNAME.profile'
- name: Copy user-specific profile which will source the oracle profile if found
copy:
src: /home/{{ whoami.stdout }}/{{ whoami.stdout }}.profile
dest: /home/{{ whoami.stdout }}/{{ whoami.stdout }}.profile
- name: Copy the oracle profile to set up the oracle path, sid, etc.
when: "'oracle' in group_names"
copy:
src: /home/{{ whoami.stdout }}/oracle.profile
dest: /home/{{ whoami.stdout }}/oracle.profile