mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2024-12-24 11:20:13 +01:00
zmb-ad-join: sync sysvol via smb
This commit is contained in:
parent
fd7d5d7ac9
commit
187a2c79c5
@ -127,10 +127,24 @@ rm -f /etc/samba/smb.conf
|
||||
echo -e "$ZMB_ADMIN_PASS" | kinit -V $ZMB_ADMIN_USER
|
||||
samba-tool domain join $ZMB_REALM DC -k yes --backend-store=mdb
|
||||
|
||||
cat > /etc/cron.d/sysvol-sync << EOF
|
||||
*/5 * * * * root /usr/bin/rsync -XAavz --delete-after root@$LXC_DNS:/var/lib/samba/sysvol/ /var/lib/samba/sysvol
|
||||
mkdir -p /mnt/sysvol
|
||||
|
||||
cat << EOF > /root/.smbcredentials
|
||||
username=$ZMB_ADMIN_USER
|
||||
password=$ZMB_ADMIN_PASS
|
||||
domain=$ZMB_DOMAIN
|
||||
EOF
|
||||
|
||||
echo "//$LXC_DNS/sysvol /mnt/sysvol cifs credentials=/root/.smbcredentials 0 0" >> /etc/fstab
|
||||
|
||||
mount.cifs //$LXC_DNS/sysvol /mnt/sysvol -o credentials=/root/.smbcredentials
|
||||
|
||||
cat > /etc/cron.d/sysvol-sync << EOF
|
||||
*/15 * * * * root /usr/bin/rsync -XAavz --delete-after /mnt/sysvol/ /var/lib/samba/sysvol
|
||||
EOF
|
||||
|
||||
/usr/bin/rsync -XAavz --delete-after /mnt/sysvol/ /var/lib/samba/sysvol
|
||||
|
||||
ssh-keygen -q -f "$HOME/.ssh/id_rsa" -N "" -b 4096
|
||||
|
||||
systemctl unmask samba-ad-dc
|
||||
|
Loading…
Reference in New Issue
Block a user