Add docker role + check for python

This commit is contained in:
Jesper Hess 2018-05-10 11:19:54 +02:00
parent bdad6a1683
commit 5b96b26593
Signed by untrusted user: graffen
GPG key ID: 351A89E40D763F0F
2 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,17 @@
---
- name: add docker gpg key
apt_key:
keyserver: pgp.key-server.io
id: 8D81803C0EBFCD88
state: present
- name: add docker apt repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu artful stable
state: present
update_cache: yes
- name: install docker-ce
apt:
name: docker-ce
state: present

View file

@ -1,4 +1,14 @@
---
- hosts: all
gather_facts: False
pre_tasks:
- name: install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
register: output
changed_when: output.stdout != ""
- setup:
- name: "Include host secrets where applicable"
hosts: "all"
tasks:
@ -11,4 +21,10 @@
hosts: "all"
become: yes
roles:
- "ubuntu_base"
- "ubuntu_base"
- name: "Install docker on all kubernetes servers"
hosts: "all_kubernetes_servers"
become: yes
roles:
- "docker"