Add docker role + check for python
This commit is contained in:
parent
bdad6a1683
commit
5b96b26593
17
roles/docker/tasks/main.yml
Normal file
17
roles/docker/tasks/main.yml
Normal 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
|
|
@ -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"
|
- name: "Include host secrets where applicable"
|
||||||
hosts: "all"
|
hosts: "all"
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -12,3 +22,9 @@
|
||||||
become: yes
|
become: yes
|
||||||
roles:
|
roles:
|
||||||
- "ubuntu_base"
|
- "ubuntu_base"
|
||||||
|
|
||||||
|
- name: "Install docker on all kubernetes servers"
|
||||||
|
hosts: "all_kubernetes_servers"
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- "docker"
|
Loading…
Reference in a new issue