Install specific docker version

This commit is contained in:
2017-06-20 07:35:11 -04:00
parent 6590e27367
commit 301af677d3
2 changed files with 24 additions and 41 deletions

View File

@@ -2,3 +2,4 @@
# Variables listed here are applicable to all host groups
docker_compose_version_to_install: 1.13.0
docker_ce_version_to_install: 17.03.0~ce-0~ubuntu-{{ ansible_distribution_release }}

View File

@@ -1,44 +1,35 @@
---
# This playbook contains plays that will run on all nodes
- name: Get docker key
shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
- name: Add docker repo
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
state: present
- name: Update apt
apt: update_cache=yes
- name: Upgrade APT to the lastest packages
apt: upgrade=dist
- name: Install htop
apt: name=htop state=present
- name: Install curl
apt: name=curl state=present
- name: Install openssh-server
apt: name=openssh-server state=present
- name: Install git
apt: name=git state=present
- name: Install rsync
apt: name=rsync state=present
- name: Install zip
apt: name=zip state=present
- name: Install unzip
apt: name=unzip state=present
- name: Install fail2ban
apt: name=fail2ban state=present
- name: Install ntp
apt: name=ntp state=present
- name: Install mysql-client
apt: name=mysql-client state=present
- name: Install wget
apt: name=wget state=present
- name: Install standard programes
apt: name={{ item }} state=present
with_items:
- htop
- curl
- openssh-server
- git
- rsync
- zip
- unzip
- fail2ban
- ntp
- mysql-client
- wget
- docker-ce={{docker_ce_version_to_install}}
- name: Set git username
shell: git config --global user.name "Jacob Cody Wimer"
@@ -46,15 +37,6 @@
- name: Set git email
shell: git config --global user.email "jacob.wimer@gmail.com"
- name: Is docker installed
shell: which docker
register: docker_installed
failed_when: "docker_installed.rc == 2 or docker_installed.rc == 3"
- name: Get docker
shell: curl -sSL https://get.docker.com/ | sh
when: docker_installed.stdout == ""
- name: Docker compose version
shell: docker-compose --version
register: docker_compose_version