-
Notifications
You must be signed in to change notification settings - Fork 0
/
addhost.yml
56 lines (56 loc) · 1.55 KB
/
addhost.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
- name: Adding host to ipa-controller
hosts: localhost
vars:
cred_name: "cred"
vars_files:
- "vars.yml"
- "{{ cred_name }}.yml"
tasks:
- name: add host to ipa
ipa_host:
name: "{{ server_name }}"
description: "{{ server_description }}"
state: present
force: True
random_password: True
ipa_host: "{{ ipa_server }}"
ipa_user: "{{ ipa_user }}"
ipa_pass: "{{ ipa_pass }}"
validate_certs: False
register: host
# - name: print result
# - debug: msg="{{ host.host.randompassword }}"
- name: create stack
os_stack:
auth:
auth_url: "{{ os_auth_url }}"
username: "{{ os_username }}"
password: "{{ os_password }}"
project_id: "{{ os_project_id }}"
project_name: "{{ os_project_name }}"
user_domain_name: "{{ os_user_domain_name }}"
# identity_api_version: 3
interface: "public"
# region_name: "RegionOne"
name: "{{ server_name }}"
tag: "{{ server_name }}"
state: present
# template: "simple_yaml.yaml"
template: "complex.yml"
parameters:
ipapass: "{{ host.host.randompassword }}"
instname: "{{ server_name }}"
flavor: "{{ flavor }}"
image_name: "{{ image_name }}"
root_size: "{{ root_size }}"
data_size: "{{ data_size }}"
ssh_key: "{{ ssh_key }}"
network_id: "{{ network_id }}"
subnet_id: "{{ subnet_id }}"
wait: yes
register: stack
- name: print result of stack operation
debug:
var: stack
...