File tree Expand file tree Collapse file tree 2 files changed +50
-4
lines changed
var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks Expand file tree Collapse file tree 2 files changed +50
-4
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,6 @@ Before=rsync.service docker.service
24
24
Type =oneshot
25
25
ExecStart =/var/lib/delphix-platform/ansible/apply
26
26
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
-
31
27
RemainAfterExit =yes
32
28
33
29
#
Original file line number Diff line number Diff line change 684
684
path : /etc/environment
685
685
state : absent
686
686
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
You can’t perform that action at this time.
0 commit comments