2021-05-21 16:24:38 +00:00
|
|
|
Docker
|
2019-08-29 07:27:08 +00:00
|
|
|
=========
|
|
|
|
|
2021-05-21 16:24:38 +00:00
|
|
|
An ansible role to configure docker on a remote host. This can be used to
|
|
|
|
configure one or several servers with basic docker and docker-compose settings.
|
2019-08-29 07:27:08 +00:00
|
|
|
|
|
|
|
Requirements
|
|
|
|
------------
|
|
|
|
|
2021-05-21 16:24:38 +00:00
|
|
|
This role will only function correctly on Ubuntu servers, or some debian
|
|
|
|
derivative that also uses the `apt` package manager.
|
2019-08-29 07:27:08 +00:00
|
|
|
|
|
|
|
Role Variables
|
|
|
|
--------------
|
|
|
|
|
2021-05-21 16:24:38 +00:00
|
|
|
`docker_users: [user1, user2]`
|
|
|
|
* Existing users that the role will add to the docker groups to ensure
|
|
|
|
command access
|
2019-08-29 07:27:08 +00:00
|
|
|
|
|
|
|
Example Playbook
|
|
|
|
----------------
|
|
|
|
|
2021-05-21 16:24:38 +00:00
|
|
|
First, make sure all settings within `defaults/main.yml` are correct for your
|
|
|
|
server. All settings and their purposes are outline in the section above.
|
|
|
|
|
|
|
|
Create a new ansible play. You can name it whatever you want, but this
|
|
|
|
example play will simply be named `docker.yml`.
|
2020-04-15 23:03:42 +00:00
|
|
|
|
2021-05-21 16:24:38 +00:00
|
|
|
```yml
|
|
|
|
---
|
|
|
|
- hosts: testserver
|
|
|
|
become: yes
|
|
|
|
roles:
|
|
|
|
- docker
|
|
|
|
```
|
|
|
|
|
|
|
|
Make sure the IP for `testserver` is correct in the `/etc/ansible/hosts` file -
|
|
|
|
```
|
|
|
|
[testserver]
|
|
|
|
123.123.123.123:22
|
|
|
|
```
|
|
|
|
|
|
|
|
Run the play!
|
|
|
|
|
|
|
|
```bash
|
|
|
|
ansible-playbook docker.yml
|
|
|
|
```
|
2020-04-15 23:03:42 +00:00
|
|
|
|
|
|
|
License
|
|
|
|
-------
|
2019-08-29 07:27:08 +00:00
|
|
|
|
2020-04-15 23:03:42 +00:00
|
|
|
BSD
|
2019-08-29 07:27:08 +00:00
|
|
|
|
2020-04-15 23:03:42 +00:00
|
|
|
Author Information
|
|
|
|
------------------
|
2019-08-29 07:27:08 +00:00
|
|
|
|
2021-05-21 16:24:38 +00:00
|
|
|
Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0
|
|
|
|
|
|
|
|
TODO: Update to follow the more recent official docker installation instructions
|