File tree Expand file tree Collapse file tree 3 files changed +27
-57
lines changed
var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks Expand file tree Collapse file tree 3 files changed +27
-57
lines changed Original file line number Diff line number Diff line change 1717
1818case $1 in
1919upgrade)
20- # Home directories were previously mounted under /export/home,
21- # and this was changed to /home. This is the upgrade logic that
22- # updates the /etc/fstab file to reflect that change.
23- # Home directories will be mounted in both /export/home and /home
24- # until the system is rebooted to ensure that running processes
25- # referencing the old /export/home paths continue to function
26- # while also enabling new logins under /home to work.
20+ # Home directories were previously mounted under /export/home,
21+ # and this was changed to /home. This is the upgrade logic that
22+ # updates the /etc/fstab file to reflect that change.
23+ # Home directories will be mounted in both /export/home and /home
24+ # until the system is rebooted to ensure that running processes
25+ # referencing the old /export/home paths continue to function
26+ # while also enabling new logins under /home to work.
2727 fs_tab=/etc/fstab
2828 auto_master=/etc/auto.master
2929
Original file line number Diff line number Diff line change @@ -24,6 +24,26 @@ Before=rsync.service docker.service
2424Type =oneshot
2525ExecStart =/var/lib/delphix-platform/ansible/apply
2626ExecStart =/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 '\
30+ echo "Ensuring /export/home is a symlink to /home..."; \
31+ if mountpoint -q /export/home; then \
32+ echo "/export/home is a mountpoint, unmounting..."; \
33+ umount /export/home || { echo "Failed to unmount /export/home"; exit 1; }; \
34+ fi; \
35+ if [ -e /export/home ] && [ ! -L /export/home ]; then \
36+ echo "Removing existing /export/home directory..."; \
37+ rm -rf /export/home; \
38+ fi; \
39+ if [ ! -d /export ]; then \
40+ mkdir /export; \
41+ fi; \
42+ if [ -d /export ] && [ ! -L /export/home ]; then \
43+ echo "Creating symlink: /export/home -> /home"; \
44+ ln -s /home /export/home; \
45+ fi;'
46+
2747RemainAfterExit =yes
2848
2949#
Original file line number Diff line number Diff line change 738738 path : /etc/environment
739739 state : absent
740740 regexp : ' ^\s*PATH\s*='
741-
742- #
743- # Soft link creation in case it doesn't exist
744- #
745- - name : Check export
746- ansible.builtin.stat :
747- path : /export
748- register : export_status
749-
750- - name : Check export home
751- ansible.builtin.stat :
752- path : /export/home
753- when : export_status.stat.exists and export_status.stat.isdir
754- register : export_home_status
755-
756- #
757- # Before deleting the /export/home directory if the
758- # home data set is mounted on /export/home if its
759- # mounted remove if first and then go ahead.
760- #
761- - name : Check if the path is mounted
762- ansible.builtin.shell : |
763- mount | grep /export/home
764- register : mount_status
765- ignore_errors : yes
766-
767- - name : Unmount the path if it is mounted
768- ansible.builtin.mount :
769- path : /export/home
770- state : unmounted
771- when : mount_status.rc == 0
772-
773- - name : Delete home directory
774- ansible.builtin.file :
775- path : /export/home
776- state : absent
777- when : not export_status.stat.exists or export_home_status.stat.exists and export_home_status.stat.isdir
778-
779- - name : Create export directory
780- ansible.builtin.file :
781- path : /export
782- state : directory
783- mode : 0755
784- when : not export_status.stat.exists
785-
786- - name : Create the soft link
787- ansible.builtin.file :
788- src : /home
789- dest : /export/home
790- state : link
You can’t perform that action at this time.
0 commit comments