vagrant virtualbox backed docker swarm environment provisioned with ansible.
Each node of the virtualbox backed cluster is configured with 4GB RAM and 2CPU's. Update the provider configuration to change the defaults.
Update the ansible_eth0 variable with the interface that the swarm manager should advertise itself on: sed -i -e "s/ansible_enp0s8/ansible_eth0/g" playbooks/deploy.yml
Build the environment using vagrant: vagrant up
The openssh-server:latest image will be loaded on all nodes if the file exists at /vagrant/openssh-server/openssh-server.tar.gz during the provisioning.
Note: the swarm nodes are provisioned in parallel with ansible using the tips & tricks.
- connect to the manager node:
vagrant ssh node1 - create a passwordless
sshrsa key pair for thevagrantuser i.e.:ssh-keygen -N "" -m PEM -t rsa -b 4096 -C "vagrant@bastion" -f ~/.ssh/id_rsa - set the
REGISTRY_HTTP_SECRETenvironment variable and deploy the bastion stack
cd /vagrant
REGISTRY_HTTP_SECRET=$(openssl rand -base64 32) docker stack deploy --compose-file docker-compose.yml bastion- test the
openssh-serverconnections:ssh -p 443 ubuntu@localhost - test the
registryconnections:
docker tag openssh-server:latest docker.localhost/openssh-server:latest
docker push docker.localhost/openssh-server:latest