blob: 33622b072768c3ba1076368402a8099e72c02515 [file] [log] [blame]
Matteo Scandolof0441032017-08-08 13:05:26 -07001
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
Scott Bakerb63ea792016-08-11 10:24:48 -070017---
18- hosts: 127.0.0.1
19 connection: local
20 tasks:
21 - os_network:
Zack Williams9cb1f3a2017-08-20 19:35:03 -070022 auth:
23 auth_url: "{{ endpoint }}"
24 username: "{{ admin_user }}"
25 password: "{{ admin_password }}"
26 project_name: "{{ admin_project }}"
27 name: "{{ name }}"
28 shared: true
29 {% if not delete -%}
30 state: present
31 {% else -%}
32 state: absent
33 {% endif -%}
Scott Bakerb63ea792016-08-11 10:24:48 -070034
35{% if not delete %}
36 - os_subnet:
Zack Williams9cb1f3a2017-08-20 19:35:03 -070037 auth:
38 auth_url: "{{ endpoint }}"
39 username: "{{ admin_user }}"
40 password: "{{ admin_password }}"
41 project_name: "{{ admin_project }}"
42 name: "{{ subnet_name }}"
43 network_name: "{{ name }}"
Scott Bakerb63ea792016-08-11 10:24:48 -070044 {% if not delete -%}
45 state: present
Zack Williams9cb1f3a2017-08-20 19:35:03 -070046 cidr: "{{ cidr }}"
47 dns_nameservers: "8.8.8.8"
Scott Bakerb63ea792016-08-11 10:24:48 -070048 {% if use_vtn -%}
Zack Williams9cb1f3a2017-08-20 19:35:03 -070049 gateway_ip: "{{ gateway }}"
50 {% else -%}
51 no_gateway_ip: yes
Scott Bakerb63ea792016-08-11 10:24:48 -070052 {% endif -%}
53 {% if start_ip -%}
Zack Williams9cb1f3a2017-08-20 19:35:03 -070054 allocation_pool_start: "{{ start_ip }}"
Scott Bakerb63ea792016-08-11 10:24:48 -070055 {% endif -%}
56 {% if end_ip -%}
Zack Williams9cb1f3a2017-08-20 19:35:03 -070057 allocation_pool_end: "{{ end_ip }}"
Scott Bakerb63ea792016-08-11 10:24:48 -070058 {% endif -%}
59 {% else -%}
60 state: absent
61 {% endif -%}
Scott Bakerb63ea792016-08-11 10:24:48 -070062{% endif %}
63