2017-02-22 00:58:24 +08:00
|
|
|
---
|
|
|
|
- name: allow apt to use a repository over https (debian)
|
|
|
|
package:
|
2018-11-08 17:26:58 +08:00
|
|
|
name: ['apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common']
|
2017-02-22 00:58:24 +08:00
|
|
|
state: present
|
|
|
|
update_cache: yes
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-02-22 00:58:24 +08:00
|
|
|
|
|
|
|
- name: add docker's gpg key
|
|
|
|
apt_key:
|
|
|
|
url: https://apt.dockerproject.org/gpg
|
|
|
|
state: present
|
2018-12-20 17:00:26 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-02-22 00:58:24 +08:00
|
|
|
|
|
|
|
- name: add docker and debian testing repository
|
|
|
|
apt_repository:
|
|
|
|
repo: "{{ item }}"
|
|
|
|
state: present
|
2018-04-26 17:42:11 +08:00
|
|
|
update_cache: no
|
|
|
|
register: add_docker_apt_repo
|
2017-02-22 00:58:24 +08:00
|
|
|
with_items:
|
|
|
|
- "deb https://apt.dockerproject.org/repo/ debian-{{ ansible_distribution_release }} main"
|
|
|
|
- "deb http://http.us.debian.org/debian/ testing contrib main"
|
|
|
|
|
2018-04-26 17:42:11 +08:00
|
|
|
- name: update apt cache
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
when: add_docker_apt_repo | changed
|
|
|
|
register: update_docker_apt_cache
|
|
|
|
until: update_docker_apt_cache | success
|
|
|
|
retries: 5
|
|
|
|
delay: 2
|
|
|
|
|
2017-02-22 00:58:24 +08:00
|
|
|
- name: install pip from testing on debian
|
|
|
|
package:
|
|
|
|
name: python-pip
|
|
|
|
state: present
|
|
|
|
default_release: testing
|
|
|
|
update_cache: yes
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-02-22 00:58:24 +08:00
|
|
|
|
|
|
|
- name: install docker-py via pip for debian
|
|
|
|
pip:
|
|
|
|
name: docker-py
|
|
|
|
state: latest
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2018-10-31 00:13:20 +08:00
|
|
|
tags:
|
|
|
|
- skip_ansible_lint
|
2017-02-22 00:58:24 +08:00
|
|
|
|
2018-12-19 21:55:01 +08:00
|
|
|
|
2017-02-22 00:58:24 +08:00
|
|
|
- name: install docker on debian
|
|
|
|
package:
|
2018-10-12 11:26:04 +08:00
|
|
|
name: "{{ 'docker-ce' if ansible_architecture == 'aarch64' else 'docker-engine' }}"
|
2017-02-22 00:58:24 +08:00
|
|
|
state: present
|
|
|
|
update_cache: yes
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-02-22 00:58:24 +08:00
|
|
|
|
|
|
|
# NOTE (jimcurtis): need at least version 1.9.0 of six or we get:
|
|
|
|
# re:NameError: global name 'DEFAULT_DOCKER_API_VERSION' is not defined
|
|
|
|
- name: install six via pip
|
|
|
|
pip:
|
|
|
|
name: six
|
|
|
|
version: 1.9.0
|
2018-12-20 17:00:26 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|