Bootstrap docker role
This commit is contained in:
commit
33b5ada460
7 changed files with 93 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
tests/test.retry
|
13
LICENCE
Normal file
13
LICENCE
Normal file
|
@ -0,0 +1,13 @@
|
|||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2019 Wilfried OLLIVIER <wollivier@bearstech.com>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
33
README.md
Normal file
33
README.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
galaxy-docker
|
||||
=============
|
||||
|
||||
Install Docker on Debian
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Needs [galaxy-vagrant](https://git.stdcall.me/ansible-galaxy/galaxy-vagrant) to run tests
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
None
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
None
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
- hosts: servers
|
||||
roles:
|
||||
- galaxy-docker
|
||||
|
||||
Run tests
|
||||
---------
|
||||
|
||||
Ensure galaxy-vagrant is up
|
||||
|
||||
ansible-playbook -i tests/inventory tests/test.yml
|
38
tasks/main.yml
Normal file
38
tasks/main.yml
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
# tasks file for galaxy-docker
|
||||
|
||||
# Source https://docs.docker.com/install/linux/docker-ce/debian/
|
||||
|
||||
# Ensure some packages and update
|
||||
- name: Ensure packages
|
||||
apt:
|
||||
name: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg2', 'software-properties-common']
|
||||
state: latest
|
||||
update_cache: yes
|
||||
|
||||
# Add docker GPG key
|
||||
- name: Add docker GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/debian/gpg
|
||||
state: present
|
||||
|
||||
# Ensure docker repository in apt
|
||||
- name: Ensure docker repository
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
|
||||
state: present
|
||||
filename: docker
|
||||
|
||||
# Ensure docker-ce package
|
||||
- name: Ensure docker-ce pkg
|
||||
apt:
|
||||
name: docker-ce
|
||||
state: latest
|
||||
update_cache: yes
|
||||
|
||||
# Start and enable docker-ce
|
||||
- name: Start and enable docker-ce
|
||||
systemd:
|
||||
name: docker.service
|
||||
state: started
|
||||
enabled: yes
|
1
tests/inventory
Normal file
1
tests/inventory
Normal file
|
@ -0,0 +1 @@
|
|||
galaxy-vagrant.example.com
|
5
tests/test.yml
Normal file
5
tests/test.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- hosts: galaxy-vagrant.example.com
|
||||
remote_user: root
|
||||
roles:
|
||||
- ../galaxy-docker
|
2
vars/main.yml
Normal file
2
vars/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
# vars file for galaxy-docker
|
Loading…
Reference in a new issue