Project

General

Profile

lizard-sysvol-script.aca-dc.txt

Daniel Dehennin, 10/28/2019 09:15 AM

Download (3.4 KB)

 
1
#!/bin/bash
2

    
3
salt-ssh --output yaml 'acadc*' file.write /usr/share/eole/bastion/data/91-lizardfs args='["#!/bin/bash", "/sbin/iptables -A eth0-root -p tcp -m multiport --dports 9419,9420,9421,9422,9424,9425 -j ACCEPT"]'
4
salt-ssh --output yaml 'acadc*' file.set_mode /usr/share/eole/bastion/data/91-lizardfs 0755
5
salt-ssh --output yaml 'acadc*' cmd.run 'bastion regen'
6
salt-ssh --output yaml 'acadc*' service.stop samba-ad-dc.service
7
salt-ssh --output yaml 'acadc*' file.remove /etc/cron.d/sysvol-sync
8
salt-ssh --output yaml 'acadc*' service.restart cron
9
salt-ssh --output yaml 'acadc*' hosts.add_host 192.168.0.5 mfsmaster
10
salt-ssh --output yaml 'acadc*' hosts.add_host 192.168.0.6 mfsshadow
11
salt-ssh --output yaml 'acadc*' pkg.install lizardfs-master
12
salt-ssh --output yaml 'acadc2' file.write /etc/lizardfs/mfsmaster.cfg 'PERSONALITY = shadow'
13
salt-ssh --output yaml 'acadc*' file.write /etc/lizardfs/mfsexports.cfg args="['127.0.0.1 / rw,maproot=0','192.168.0.0/24 /home/sysvol rw,maproot=0']"
14
salt-ssh --output yaml 'acadc*' file.copy /var/lib/lizardfs/metadata.mfs.empty /var/lib/lizardfs/metadata.mfs
15
salt-ssh --output yaml 'acadc*' service.enable lizardfs-master
16
salt-ssh --output yaml 'acadc*' service.start lizardfs-master
17
salt-ssh --output yaml 'acadc*' pkg.install lizardfs-chunkserver
18
salt-ssh --output yaml 'acadc*' disk.wipe /dev/sdb
19
salt-ssh --output yaml 'acadc*' lvm.pvcreate /dev/sdb
20
salt-ssh --output yaml 'acadc*' lvm.vgcreate lizardfs-vg /dev/sdb
21
salt-ssh --output yaml 'acadc*' lvm.lvcreate lizardfs-chunk lizardfs-vg size=50G
22
salt-ssh --output yaml 'acadc*' extfs.mkfs /dev/lizardfs-vg/lizardfs-chunk fs_type=ext4
23
salt-ssh --output yaml 'acadc*' file.mkdir /srv/lizardfs/root
24
salt-ssh --output yaml 'acadc*' file.mkdir /srv/lizardfs/chunk
25
salt-ssh --output yaml 'acadc*' mount.set_fstab /srv/lizardfs/chunk /dev/lizardfs-vg/lizardfs-chunk ext4
26
salt-ssh --output yaml 'acadc*' mount.fstab
27
salt-ssh --output yaml 'acadc*' mount.mount /srv/lizardfs/chunk ext4
28
salt-ssh --output yaml 'acadc*' file.chown /srv/lizardfs/chunk lizardfs lizardfs
29
salt-ssh --output yaml 'acadc*' file.set_mode /srv/lizardfs/chunk 0700
30
salt-ssh --output yaml 'acadc*' file.write /etc/lizardfs/mfshdd.cfg /srv/lizardfs/chunk
31
salt-ssh --output yaml 'acadc*' service.enable lizardfs-chunkserver
32
salt-ssh --output yaml 'acadc*' service.start lizardfs-chunkserver
33
salt-ssh --output yaml 'acadc*' pkg.install lizardfs-cgiserv
34
salt-ssh --output yaml 'acadc*' service.enable lizardfs-cgiserv
35
salt-ssh --output yaml 'acadc*' service.start lizardfs-cgiserv
36
salt-ssh --output yaml 'acadc*' pkg.install lizardfs-client
37
salt-ssh --output yaml 'acadc1' cmd.run 'mfsmount /srv/lizardfs/root -H 127.0.0.1 -S /'
38
salt-ssh --output yaml 'acadc1' file.mkdir /srv/lizardfs/root/home/
39
salt-ssh --output yaml 'acadc1' rsync.rsync /home/sysvol/ /srv/lizardfs/root/home/sysvol/ additional_opts='["--acls", "--xattrs"]'
40
salt-ssh --output yaml 'acadc*' file.rename /home/sysvol /home/before-lizardfs-sysvol
41
salt-ssh --output yaml 'acadc*' file.mkdir /home/sysvol
42
salt-ssh --output yaml 'acadc*' mount.set_fstab /home/sysvol mfsmount fuse opts='mfssubfolder=/home/sysvol,mfsdelayedinit,mfsacl,_netdev'
43
salt-ssh --output yaml 'acadc*' mount.fstab
44
salt-ssh --output yaml 'acadc*' mount.mount /home/sysvol fuse
45
salt-ssh --output yaml 'acadc*' file.readdir /home/sysvol
46
salt-ssh --output yaml 'acadc1' cmd.run 'lizardfs setgoal -r 2 /home/sysvol'
47
salt-ssh --output yaml 'acadc*' service.start samba-ad-dc.service