Minimal Ansible playbook for managing docker, firewall, and system users
This playbook contains configuration for:
- docker installation
- firewall setup (using
DOCKER_USER
chain. Docker remains running with enablediptables
) - zsh and oh-my-zsh configuration
- adding specified users
- disabled logging in using
root
user
- Clone this repository:
git clone git@github.com:damian-szulc/ansible-docker-host-playbook.git
- Fill in hosts file. For example:
[hosts_group]
host1 ansible_host=<host IP here>
- Modify group_vars, e.g.:
firewall_allow:
- proto: tcp
port: 22
- proto: tcp
port: 80
- proto: tcp
port: 443
users:
- ted
- mark
-
Copy ssh keys into following location
files/keys/{{ username }}/id_rsa.pub
(for examplefiles/keys/ted/id_rsa.pub
). -
Run ansible. The first time you should most likely use
root
user. Later, logging in usingroot
will be disabled and you should use your own user.
ansible-playbook -i hosts playbook.yml -u root