############################################################################# # Copyright (c) 2016 The Linux Foundation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################# --- - name: Ensure old versions of Docker are not installed. package: name: '{{ item }}' state: absent with_items: - docker - docker-engine - name: Ensure depdencies are installed. apt: name: "{{ item }}" state: present with_items: - apt-transport-https - ca-certificates - git - build-essential - curl - wget - rpm - fuseiso - createrepo - genisoimage - libfuse-dev - dh-autoreconf - pkg-config - zlib1g-dev - libglib2.0-dev - libpixman-1-dev - python-virtualenv - python-dev - libffi-dev - libssl-dev - libxml2-dev - libxslt1-dev - bc - qemu-kvm - libvirt-bin - ubuntu-vm-builder - bridge-utils - monit - openjdk-8-jre-headless - python-nose - dirmngr - collectd - flex - bison - libnuma-dev - shellcheck - python-pip - sysstat - xmlstarlet - facter - jq - python-tox - collectd-dev - python3 - python3-dev - libdpdk-dev - dpdk-dev - fakeroot - devscripts - debhelper - dpkg-dev - po-debconf - dh-systemd - dh-strip-nondeterminism - autotools-dev - libltdl-dev - iptables-dev - javahelper - libatasmart-dev - libcap-dev - libcurl4-gnutls-dev - libdbi0-dev - libesmtp-dev - libganglia1-dev - libgcrypt11-dev - libgps-dev - libhiredis-dev - libi2c-dev - libldap2-dev - liblua5.3-dev - liblvm2-dev - libmemcached-dev - libmodbus-dev - libmnl-dev - libmosquitto-dev - libmysqlclient-dev - libnotify-dev - libopenipmi-dev - liboping-dev - libow-dev - libpcap0.8-dev - libpcap-dev - libperl-dev - libpq-dev - libprotobuf-c-dev - libriemann-client-dev - librdkafka-dev - librabbitmq-dev - librrd-dev - libsensors4-dev - libsigrok-dev - libsnmp-dev - libsnmp9-dev - snmp - snmp-mibs-downloader - snmpd - perl - libtokyocabinet-dev - libtokyotyrant-dev - libudev-dev - libupsclient-dev - libvarnishapi-dev - libvirt-dev - libvirt-daemon - libxen-dev - libyajl-dev - linux-libc-dev - default-jdk - protobuf-c-compiler - openvswitch-switch - mcelog - name: Add Docker apt key. apt_key: url: https://download.docker.com/linux/ubuntu/gpg id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 state: present register: add_repository_key ignore_errors: true - name: Ensure curl is present (on older systems without SNI). package: name=curl state=present when: add_repository_key|failed - name: Add Docker apt key (alternative for older systems without SNI). # yamllint disable rule:line-length shell: "curl -sSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -" # yamllint enable rule:line-length args: warn: "no" when: add_repository_key|failed - name: Add Docker repository. apt_repository: repo: "{{ docker_apt_repository }}" state: present update_cache: "yes"