Hi all,
I want to share one small playbook with you, it will help you with installation of new Debian 8 server and if you need docker and docker-composer installed with only one command.
Task in this playbook are
- Update && upgrade
- Install debian keyrings
- Install dependency
- Add docker and backports repository
- Install and pip upgrade (to get last version of docker-compose)
- Add your user to docker group (no need to run docker daemon as root in most of the cases)
- Reboot your server after all settings and start docker-engine
You will need ansible 2.2+ and Debian 8 (tested with Debian 8.6)
How to use
Clone repo https://github.com/ZEROF/ansible
- Folder debian-docker
You will need to add ssh key to your Debian machine:
ssh-copy-id -i ~/.ssh/id_rsa user@serverip
If you don't have ssh key:
ssh-keygen -t rsa -b 4096
After this you will need to edit /etc/ansible/hosts file(set your server info):
[docker]
debian ansible_host=server_ip ansible_user=server_user_name ansible_su_pass=user_password ansible_ssh_private_key_file=~/.ssh/id_rsa
Edit vars in debian-docker/roles/docker/vars/main.yml
host_ip: your_server_ip
user: server_nonroot_user
Run playbook:
ansible-playbook install-docker-debian8-playbook.yml
Have a nice day/night!