Skip to content

Commit 74091ab

Browse files
committed
Changing the code to previous version to validate the comments.
1 parent 2432cfa commit 74091ab

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

files/common/lib/systemd/system/delphix-platform.service

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ Before=rsync.service docker.service
2424
Type=oneshot
2525
ExecStart=/var/lib/delphix-platform/ansible/apply
2626
ExecStart=/var/lib/delphix-platform/dynamic-debug
27-
28-
# Create /export/home symlink to /home if it doesn't already exist
29-
ExecStartPost=/bin/sh -c '[ -L /export/home ] || ln -s /home /export/home'
30-
3127
RemainAfterExit=yes
3228

3329
#

files/common/var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks/main.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,3 +684,53 @@
684684
path: /etc/environment
685685
state: absent
686686
regexp: '^\s*PATH\s*='
687+
688+
#
689+
# Soft link creation in case it doesn't exist
690+
#
691+
- name: Check export
692+
ansible.builtin.stat:
693+
path: /export
694+
register: export_status
695+
696+
- name: Check export home
697+
ansible.builtin.stat:
698+
path: /export/home
699+
when: export_status.stat.exists and export_status.stat.isdir
700+
register: export_home_status
701+
702+
#
703+
# Before deleting the /export/home directory if the
704+
# home data set is mounted on /export/home if its
705+
# mounted remove if first and then go ahead.
706+
#
707+
- name: Check if the path is mounted
708+
ansible.builtin.shell: |
709+
mount | grep /export/home
710+
register: mount_status
711+
ignore_errors: yes
712+
713+
- name: Unmount the path if it is mounted
714+
ansible.builtin.mount:
715+
path: /export/home
716+
state: unmounted
717+
when: mount_status.rc == 0
718+
719+
- name: Delete home directory
720+
ansible.builtin.file:
721+
path: /export/home
722+
state: absent
723+
when: not export_status.stat.exists or export_home_status.stat.exists and export_home_status.stat.isdir
724+
725+
- name: Create export directory
726+
ansible.builtin.file:
727+
path: /export
728+
state: directory
729+
mode: 0755
730+
when: not export_status.stat.exists
731+
732+
- name: Create the soft link
733+
ansible.builtin.file:
734+
src: /home
735+
dest: /export/home
736+
state: link

0 commit comments

Comments
 (0)