blob: 122472318c312f588b80e91278a54341821bf547 [file] [log] [blame]
boyoungf42f2bf2017-10-16 19:06:30 +09001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
boyoung24b12a62017-10-12 10:32:44 +090017---
18- hosts: {{ swarm_manager_address }}
19 become: true
20 tasks:
21 {% if delete -%}
22 - name: delete a docker network '{{ network_name }}'
23 shell: docker network rm {{ network_name }}
24 {% elif duplicated -%}
25 - name: network list on swarm cluster
26 shell: docker network ls
27 - name: network inspection '{{ network_name }}'
28 shell: docker network inspect {{ network_name }}
29 {% else -%}
30 - name: create a docker network '{{ network_name }}'
31 shell: docker network create {{ opt_driver }} {{ opt_ipam_driver }} {{ opt_subnet }} {{ opt_gateway }} {{ opt_ipam_neutron_opt }} {{ network_name }}
32 - name: network inspection '{{ network_name }}'
33 shell: docker network inspect {{ network_name }}
34 {% endif -%}