summaryrefslogtreecommitdiffstats
path: root/utils/build-server-ansible/vars/Ubuntu.yml
blob: f50255868c90056bc6a6233d44a4aee9ef51fa4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#############################################################################
# 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

- 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"