Add ansible scripts to deploy Kubernetes
[yardstick.git] / ansible / roles / docker / tasks / main.yml
1 # Copyright (c) 2017-2019 Intel Corporation.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 ---
15   - name: Install docker
16     include: "{{ ansible_os_family }}.yml"
17
18   - name: create docker service config dir
19     file: path=/etc/systemd/system/docker.service.d state=directory
20
21   - name: docker configuration
22     template: src=daemon.json.j2 dest=/etc/docker/daemon.json owner=root mode=0644
23     when: 'docker_daemon_config is defined'
24
25   - name: create docker proxy config
26     template: src=http-proxy-conf.j2 dest=/etc/systemd/system/docker.service.d/http-proxy.conf owner=root mode=0644
27     when: 'proxy_env is defined and "http_proxy" in proxy_env or "https_proxy" in proxy_env'
28     notify:
29      - systemd daemon reload
30      - restart docker
31
32   - name: start docker service
33     service: name=docker state=started enabled=yes
34
35   - meta: flush_handlers