blob: c445fb63e78e2f9c8b3f4ae4a9960fa695f44ac0 [file] [log] [blame]
Zack Williamsdb373ef2018-04-01 14:10:21 -07001---
Matteo Scandolof0441032017-08-08 13:05:26 -07002# 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
Scott Bakerb63ea792016-08-11 10:24:48 -070016- hosts: 127.0.0.1
17 connection: local
18 tasks:
Zack Williamsdb373ef2018-04-01 14:10:21 -070019
agmimidi86e3e622018-09-12 14:45:10 +020020 {% if delete -%}
21 - os_server_actions:
22 server: "{{ name }}"
23 auth:
24 auth_url: "{{ endpoint }}"
25 username: "{{ admin_user }}"
26 password: "{{ admin_password }}"
27 project_name: "{{ project_name }}"
28 {% if domain -%}
29 project_domain_name: "{{ domain }}"
30 user_domain_name: "{{ domain }}"
31 {%- endif %}
32 action: stop
33 {%- endif %}
Scott Bakerb63ea792016-08-11 10:24:48 -070034 - os_server:
Zack Williams9cb1f3a2017-08-20 19:35:03 -070035 name: "{{ name }}"
Scott Bakerb63ea792016-08-11 10:24:48 -070036 auth:
Zack Williams9cb1f3a2017-08-20 19:35:03 -070037 auth_url: "{{ endpoint }}"
38 username: "{{ admin_user }}"
39 password: "{{ admin_password }}"
40 project_name: "{{ project_name }}"
Andy Bavier66f9f342018-04-12 16:16:03 -070041 {% if domain -%}
42 project_domain_name: "{{ domain }}"
43 user_domain_name: "{{ domain }}"
44 {%- endif %}
Zack Williamsdb373ef2018-04-01 14:10:21 -070045 interface: "admin"
Scott Bakerb63ea792016-08-11 10:24:48 -070046 {% if delete -%}
47 state: absent
48 {% else -%}
49 state: present
50 availability_zone: "{{ availability_zone }}"
Zack Williams9cb1f3a2017-08-20 19:35:03 -070051 image: "{{ image_name }}"
52 flavor: "{{ flavor_name }}"
Scott Bakerb63ea792016-08-11 10:24:48 -070053 timeout: 200
54 userdata: "{{ user_data }}"
55 config_drive: yes
56 auto_ip: no
57 nics:
58 {% for nic in nics %}
59 - {{ nic.kind }}-id: {{ nic.value }}
60 {% endfor %}
61
62 {% if meta %}
63 meta:
64 {% for k,v in meta.items() %}
65 {{ k }} : "{{ v }}"
66 {% endfor %}
67 {% endif %}
68 {% endif %}
69