c3021a4e5c019506dc4c73c346452299a9a50426
[releng.git] / utils / build-server-ansible / main.yml
1 ############################################################################
2 # Copyright (c) 2016 The Linux Foundation and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 #############################################################################
8 ---
9 - hosts: "localhost"
10   become: "True"
11   tasks:
12     - debug:
13         msg: "{{ inventory_hostname }} is {{ ansible_distribution }}"
14     - include_vars: vars/defaults.yml
15     - include: vars/Centos.yml
16       when: ansible_distribution == "CentOS"
17     - include: vars/Ubuntu.yml
18       when: ansible_distribution == "Ubuntu"
19     - name: Install Docker.
20       package: name={{ docker_package }} state={{ docker_package_state }}
21     - name: Ensure Docker is started and enabled at boot.
22       service:
23         name: docker
24         state: started
25         enabled: "yes"
26     - name: install gsutil
27       pip:
28         name: gsutil
29         state: present
30     - name: install tox
31       pip:
32         name: tox
33         state: present
34     - include: vars/docker-compose-CentOS.yml
35       when: ansible_distribution == "CentOS"
36     - include: vars/docker-compose-Ubuntu.yml
37       when: ansible_distribution == "Ubuntu"