From 63b655cd7b3dcc08224d65139f669883e07fe699 Mon Sep 17 00:00:00 2001 From: Aleksandr Didenko Date: Fri, 9 Dec 2016 09:17:36 +0100 Subject: [PATCH] Convert docker_versioned_pkg dict keys to string This will allow to use '-e docker_version=1.12' in ansible playbook execution. It's also backward-compatible and will work with floating docker_version format in custom yaml files. Closes #702 --- roles/docker/defaults/main.yml | 2 +- roles/docker/vars/debian.yml | 12 ++++++------ roles/docker/vars/fedora.yml | 12 ++++++------ roles/docker/vars/ubuntu-16.04.yml | 10 +++++----- roles/docker/vars/ubuntu.yml | 12 ++++++------ 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index 196e59b4c..70289582b 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -1,4 +1,4 @@ -docker_version: 1.10 +docker_version: '1.10' docker_package_info: pkgs: diff --git a/roles/docker/vars/debian.yml b/roles/docker/vars/debian.yml index 192517097..964f59431 100644 --- a/roles/docker/vars/debian.yml +++ b/roles/docker/vars/debian.yml @@ -2,16 +2,16 @@ docker_kernel_min_version: '3.2' # https://apt.dockerproject.org/repo/dists/debian-wheezy/main/filelist docker_versioned_pkg: - latest: docker-engine - 1.9: docker-engine=1.9.1-0~{{ ansible_distribution_release|lower }} - 1.10: docker-engine=1.10.3-0~{{ ansible_distribution_release|lower }} - 1.11: docker-engine=1.11.2-0~{{ ansible_distribution_release|lower }} - 1.12: docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} + 'latest': docker-engine + '1.9': docker-engine=1.9.1-0~{{ ansible_distribution_release|lower }} + '1.10': docker-engine=1.10.3-0~{{ ansible_distribution_release|lower }} + '1.11': docker-engine=1.11.2-0~{{ ansible_distribution_release|lower }} + '1.12': docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} docker_package_info: pkg_mgr: apt pkgs: - - name: "{{ docker_versioned_pkg[docker_version] }}" + - name: "{{ docker_versioned_pkg[docker_version | string] }}" force: yes docker_repo_key_info: diff --git a/roles/docker/vars/fedora.yml b/roles/docker/vars/fedora.yml index 3fd06b4b3..1ed1a1338 100644 --- a/roles/docker/vars/fedora.yml +++ b/roles/docker/vars/fedora.yml @@ -1,16 +1,16 @@ docker_kernel_min_version: '0' docker_versioned_pkg: - latest: docker - 1.9: docker-1:1.9.1 - 1.10: docker-1:1.10.1 - 1.11: docker-1:1.11.2 - 1.12: docker-1:1.12.1 + 'latest': docker + '1.9': docker-1:1.9.1 + '1.10': docker-1:1.10.1 + '1.11': docker-1:1.11.2 + '1.12': docker-1:1.12.1 docker_package_info: pkg_mgr: dnf pkgs: - - name: "{{ docker_versioned_pkg[docker_version] }}" + - name: "{{ docker_versioned_pkg[docker_version | string] }}" docker_repo_key_info: pkg_key: '' diff --git a/roles/docker/vars/ubuntu-16.04.yml b/roles/docker/vars/ubuntu-16.04.yml index 208fe5edc..b59bbd81c 100644 --- a/roles/docker/vars/ubuntu-16.04.yml +++ b/roles/docker/vars/ubuntu-16.04.yml @@ -1,17 +1,17 @@ --- -docker_version: 1.11 +docker_version: '1.11' docker_kernel_min_version: '3.2' # https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/filelist docker_versioned_pkg: - latest: docker-engine - 1.11: docker-engine=1.11.1-0~{{ ansible_distribution_release|lower }} - 1.12: docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} + 'latest': docker-engine + '1.11': docker-engine=1.11.1-0~{{ ansible_distribution_release|lower }} + '1.12': docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} docker_package_info: pkg_mgr: apt pkgs: - - name: "{{ docker_versioned_pkg[docker_version] }}" + - name: "{{ docker_versioned_pkg[docker_version | string] }}" force: yes docker_repo_key_info: diff --git a/roles/docker/vars/ubuntu.yml b/roles/docker/vars/ubuntu.yml index 1bf8a44a0..2e73d8c2d 100644 --- a/roles/docker/vars/ubuntu.yml +++ b/roles/docker/vars/ubuntu.yml @@ -3,16 +3,16 @@ docker_kernel_min_version: '3.2' # https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/filelist docker_versioned_pkg: - latest: docker-engine - 1.9: docker-engine=1.9.0-0~{{ ansible_distribution_release|lower }} - 1.10: docker-engine=1.10.3-0~{{ ansible_distribution_release|lower }} - 1.11: docker-engine=1.11.1-0~{{ ansible_distribution_release|lower }} - 1.12: docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} + 'latest': docker-engine + '1.9': docker-engine=1.9.0-0~{{ ansible_distribution_release|lower }} + '1.10': docker-engine=1.10.3-0~{{ ansible_distribution_release|lower }} + '1.11': docker-engine=1.11.1-0~{{ ansible_distribution_release|lower }} + '1.12': docker-engine=1.12.1-0~{{ ansible_distribution_release|lower }} docker_package_info: pkg_mgr: apt pkgs: - - name: "{{ docker_versioned_pkg[docker_version] }}" + - name: "{{ docker_versioned_pkg[docker_version | string] }}" force: yes docker_repo_key_info: