Quantcast
Channel: Tutorials — LowEndTalk
Viewing all articles
Browse latest Browse all 1028

Install docker with standrad user using ansible playbook

$
0
0

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

  1. Update && upgrade
  2. Install debian keyrings
  3. Install dependency
  4. Add docker and backports repository
  5. Install and pip upgrade (to get last version of docker-compose)
  6. Add your user to docker group (no need to run docker daemon as root in most of the cases)
  7. 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!


Viewing all articles
Browse latest Browse all 1028

Trending Articles