-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing YAML to YML in Filenames & README Added
- Loading branch information
Hamid Yousefi
committed
Oct 1, 2020
1 parent
7e50721
commit 138d8b4
Showing
8 changed files
with
66 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
# Docker Installation Ansible Role | ||
# Docker Ansible Role | ||
This is a very simplified Ansible Role for installing Docker as a systemd service. | ||
I'm using this role for many personal and enterprise projects and will do my best to keep it | ||
update and customizable with the latest changes which would be useful for me (and others). | ||
|
||
This is a very simplified Ansible role for installing Docker as a systemd service. | ||
|
||
## Supporting Distributions and Their Releases | ||
## Distributions and Their Releases | ||
Right now, these OS distributions and releases are tested: | ||
- Debian | ||
- Jessie | ||
- Stretch | ||
- Buster | ||
- Ubuntu | ||
- Xenial | ||
- Bionic | ||
- Focal | ||
|
||
## Installation | ||
Everywhere in your controller machine, you just need to install it via | ||
## How to Use It | ||
You can simply install this role on your machine by using the below command: | ||
```bash | ||
ansible-galaxy install hamidyousefi.docker | ||
``` | ||
Then you can use this role in your Ansible Playbooks like: | ||
Also if you defined your playbook, you can simply add below lines to your `roles/requirements.yml`. | ||
You can create this file if your playbook doesn't have it yet. | ||
```yaml | ||
- name: hamidyousefi.docker | ||
version: master | ||
``` | ||
Of course `master` is the most updated version of this role. You should prefer to | ||
define which version you are going to use just by replacing it with something like `v1.0.0`. | ||
You can find the versions list and their changelogs from [releases page](https://github.com/hamidyousefi/ansible-docker/releases). | ||
|
||
## Additional Extensions and Configurations | ||
I added two specific extra feature to this role. `docker-compose` and `iptables` can be set up easily just | ||
by adding the below block in your `group_vars` related YAML file: | ||
```yaml | ||
--- | ||
- hosts: baremetals | ||
roles: | ||
- hamidyousefi.docker | ||
configure: | ||
compose: yes | ||
iptables: yes | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
extensions: | ||
- compose: | ||
version: 1.27.4 | ||
|
||
configure: | ||
compose: no | ||
iptables: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ galaxy_info: | |
- bionic | ||
- focal | ||
galaxy_tags: | ||
- linux | ||
- docker | ||
- containerization | ||
- containerd | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- name: installing necessary packages | ||
apt: | ||
name: | ||
- apt-transport-https | ||
- ca-certificates | ||
- curl | ||
- gnupg-agent | ||
- software-properties-common | ||
update_cache: yes | ||
state: present | ||
force_apt_get: yes | ||
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' | ||
|
||
- include: distributions/debian.yml | ||
when: ansible_distribution == 'Debian' | ||
|
||
- include: distributions/ubuntu.yml | ||
when: ansible_distribution == 'Ubuntu' | ||
|
||
- name: installing compose extension | ||
get_url: | ||
url: "https://github.com/docker/compose/releases/download/{{ compose.version | default ('1.27.4') }}/docker-compose-Linux-x86_64" | ||
dest: /usr/local/bin/docker-compose | ||
owner: root | ||
group: root | ||
mode: '0655' | ||
when: configure.compose | ||
|
||
- include: iptables.yml | ||
when: configure.iptables |