summaryrefslogtreecommitdiffstats
path: root/utils/build-server-ansible/main.yml
blob: a4d3b08cb6629a1c44bcdd3d1e30b195c39e798a (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
############################################################################
# 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
#############################################################################
---
- hosts: "localhost"
  become: "True"
  tasks:
    - debug:
        msg: "{{ inventory_hostname }} is {{ ansible_distribution }}"
    - include_vars: vars/defaults.yml
    - include: vars/CentOS.yml
      when: ansible_distribution == "CentOS"
    - include: vars/Ubuntu.yml
      when: ansible_distribution == "Ubuntu"
    - name: Install Docker.
      package: name={{ docker_package }} state={{ docker_package_state }}
    - name: Ensure Docker is started and enabled at boot.
      service:
        name: docker
        state: started
        enabled: "yes"
    - name: install gsutil
      pip:
        name: gsutil
        state: present
    - name: install tox
      pip:
        name: tox
        state: present
    - name: install yamllint
      pip:
        name: yamllint
        state: present
    - include: vars/docker-compose-CentOS.yml
      when: ansible_distribution == "CentOS"
    - include: vars/docker-compose-Ubuntu.yml
      when: ansible_distribution == "Ubuntu"
    - name: Install manifest-tool
      get_url:
        url: '{{ manifest_tool_url }}/{{ manifest_tool_version }}/manifest-tool-linux-amd64'
        dest: '{{ manifest_tool_bin_dir }}/manifest-tool'
        mode: '755'