From 33b5ada4601bcaef357fbf556f58154d5e46985e Mon Sep 17 00:00:00 2001 From: Wilfried OLLIVIER Date: Wed, 30 Jan 2019 10:16:36 +0100 Subject: [PATCH] Bootstrap docker role --- .gitignore | 1 + LICENCE | 13 +++++++++++++ README.md | 33 +++++++++++++++++++++++++++++++++ tasks/main.yml | 38 ++++++++++++++++++++++++++++++++++++++ tests/inventory | 1 + tests/test.yml | 5 +++++ vars/main.yml | 2 ++ 7 files changed, 93 insertions(+) create mode 100644 .gitignore create mode 100644 LICENCE create mode 100644 README.md create mode 100644 tasks/main.yml create mode 100644 tests/inventory create mode 100644 tests/test.yml create mode 100644 vars/main.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e7d02d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tests/test.retry \ No newline at end of file diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..a4212f1 --- /dev/null +++ b/LICENCE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2019 Wilfried OLLIVIER + + 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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..80c36cb --- /dev/null +++ b/README.md @@ -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 \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..2e48b2e --- /dev/null +++ b/tasks/main.yml @@ -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 \ No newline at end of file diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..5f383ff --- /dev/null +++ b/tests/inventory @@ -0,0 +1 @@ +galaxy-vagrant.example.com \ No newline at end of file diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..d7e2ea1 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: galaxy-vagrant.example.com + remote_user: root + roles: + - ../galaxy-docker \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..962ebd9 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for galaxy-docker \ No newline at end of file