mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2024-11-07 19:31:58 +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
|
echo -e "$ZMB_ADMIN_PASS" | kinit -V $ZMB_ADMIN_USER
|
||||||
samba-tool domain join $ZMB_REALM DC -k yes --backend-store=mdb
|
samba-tool domain join $ZMB_REALM DC -k yes --backend-store=mdb
|
||||||
|
|
||||||
cat > /etc/cron.d/sysvol-sync << EOF
|
mkdir -p /mnt/sysvol
|
||||||
*/5 * * * * root /usr/bin/rsync -XAavz --delete-after root@$LXC_DNS:/var/lib/samba/sysvol/ /var/lib/samba/sysvol
|
|
||||||
|
cat << EOF > /root/.smbcredentials
|
||||||
|
username=$ZMB_ADMIN_USER
|
||||||
|
password=$ZMB_ADMIN_PASS
|
||||||
|
domain=$ZMB_DOMAIN
|
||||||
EOF
|
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
|
ssh-keygen -q -f "$HOME/.ssh/id_rsa" -N "" -b 4096
|
||||||
|
|
||||||
systemctl unmask samba-ad-dc
|
systemctl unmask samba-ad-dc
|
||||||
|
Loading…
Reference in New Issue
Block a user