Skip to content

Commit 8652108

Browse files
prakashsuryajustsanjeev
authored andcommitted
DLPX-91435 [Forward port of DLPX-91396] All emails generated by specific cron job, are redirected to the user SMTP. (#486)
PR URL: https://www.github.com/delphix/delphix-platform/pull/486
1 parent 0e3fcf5 commit 8652108

File tree

2 files changed

+45
-3
lines changed
  • debian
  • files/common/var/lib/delphix-platform/ansible/10-delphix-platform/roles/delphix-platform/tasks

2 files changed

+45
-3
lines changed

debian/postinst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ configure)
4545
systemctl disable motd-news.service
4646
systemctl disable motd-news.timer
4747

48+
#
49+
# Various tools generate mail on the system, e.g. cron, and we don't
50+
# want those to be sent externally via SMTP (or equivalent). Thus,
51+
# we disable this service, so that it doesn't send external mails.
52+
#
53+
systemctl disable nullmailer.service
54+
4855
systemctl enable auditd.service
4956
systemctl enable delphix.target
5057
systemctl enable delphix-platform.service

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

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# it below; otherwise that task will fail.
2323
#
2424
- file:
25-
path: /export/home
25+
path: /home
2626
state: directory
2727
mode: 0755
2828

@@ -35,7 +35,26 @@
3535
shell: /bin/bash
3636
create_home: yes
3737
comment: Delphix User
38-
home: /export/home/delphix
38+
home: /home/delphix
39+
40+
#
41+
# When it's an upgrade in that case the home dateset
42+
# is required to be mounted on mount point /home
43+
# from the old mount point /export/home
44+
#
45+
- command: mount
46+
register: mount_home
47+
ignore_errors: True
48+
- set_fact:
49+
export_home: "{{ mount_home.stdout | regex_search(export_home_regex, multiline=True)}}"
50+
vars:
51+
export_home_regex: "rpool/ROOT/delphix.[a-zA-Z0-9]+/home on /export/home"
52+
- debug: msg={{ export_home }}
53+
- replace:
54+
path: /etc/fstab
55+
regexp: '/export/home'
56+
replace: '/home'
57+
when: export_home | length > 0
3958

4059
#
4160
# In order for this locale to be used (e.g. by virtualization) we need
@@ -689,7 +708,7 @@
689708
690709
- name: Source bash completion
691710
blockinfile:
692-
dest: "/export/home/delphix/.bashrc"
711+
dest: "/home/delphix/.bashrc"
693712
block: |
694713
. /etc/bash_completion.d/systemctl
695714
. /etc/bash_completion.d/zfs
@@ -705,3 +724,19 @@
705724
block: |
706725
# Set default umask value.
707726
umask 027
727+
728+
- service:
729+
name: "nullmailer"
730+
state: "stopped"
731+
when: not ansible_is_chroot
732+
733+
#
734+
# The presence of the auto_home is an issue
735+
# because this is also mounted on /home so
736+
# we need to remove this.
737+
#
738+
739+
- lineinfile:
740+
path: /etc/auto.master
741+
line: "/home auto_home -nobrowse"
742+
state: absent

0 commit comments

Comments
 (0)