## prepare all hosts
# add a cluster user with ssh and sudo access. example: dcos-user 

# add needed dependencies:
echo deb http://ftp.debian.org/debian jessie-backports main contrib non-free > /etc/apt/sources.list.d/backports.list
echo deb http://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install docker
# new kernel for more advance docker features, selinux util even if disabled, install script needs gawk, nawk will fail
apt-get install linux-image-4.5.0-0.bpo.2-amd64 selinux-utils gawk
# workaround for systemd/centos/redhat idiot /bin location
ln -s /bin/* /usr/bin/

# change docker and kernel to allow extra features
cp /lib/systemd/system/docker.service /etc/systemd/system/
sed -i 's/docker daemon/docker daemon -s overlay/' /etc/systemd/system/docker.service
sed -i 's/"quiet/"quiet cgroup_enable=memory swapaccount=1 /g' /etc/default/grub
update-grub2
# reboot to load new configs/kernel
reboot

## on the install server (example: first master server)
# check https://dcos.io/docs/1.7/administration/installing/custom/cli/ and adapt
su - dcos-user
cd $HOME/
mkdir -p genconf

cat  genconf/ip-detect
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:$PATH
echo $(ip addr show eth0 | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
EOF

chmod a+x genconf/ip-detect

# finetune for current config
cat  genconf/config.yaml
agent_list:
- 192.168.3.190
- 192.168.3.191
- 192.168.3.192
- 192.168.3.193
# Use this bootstrap_url value unless you have moved the DC/OS installer assets.
bootstrap_url: file:///opt/dcos_install_tmp
cluster_name: dcos-debian
master_discovery: static
master_list:
- 192.168.3.187
- 192.168.3.188
- 192.168.3.189
resolvers:
- 8.8.4.4
- 8.8.8.8
ssh_port: 22
ssh_user: dcos-user
EOF

cp  genconf/ssh_key && chmod 0600 genconf/ssh_key

# start of DCOS install
curl -O https://downloads.dcos.io/dcos/EarlyAccess/dcos_generate_config.sh
sudo bash dcos_generate_config.sh --genconf
# restart from here to add new agents after adding then to the config.yaml and ignore the errors about already installed nodes
sudo bash dcos_generate_config.sh --install-prereqs
sudo bash dcos_generate_config.sh --preflight
sudo bash dcos_generate_config.sh --deploy
# it will fail due a collision with the dcos and system libcurl.so.4. Remove the DCOS from /opt/mesosphere/lib/libcurl.so.4 in all machines:
for i in (cluster_machine_list) ; do ssh $i "sudo rm /opt/mesosphere/lib/libcurl.so.4" ; done
sudo bash dcos_generate_config.sh --postflight
# should report everything working

Then access to this urls (fix the IPs to your master IPs):

http://192.168.3.189/#/system/overview/components/
http://192.168.3.189:8181/exhibitor/v1/ui/index.html
http://192.168.3.189/#/services/ui/marathon/