forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
osp_infrastructure_deployment.yml
110 lines (100 loc) · 2.95 KB
/
osp_infrastructure_deployment.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
- name: Step 001.1 Deploy Infrastructure
hosts: localhost
connection: local
gather_facts: false
become: false
tags:
- step001
- step001.1
- deploy_infrastructure
environment:
OS_AUTH_URL: "{{ osp_auth_url }}"
OS_USERNAME: "{{ osp_auth_username }}"
OS_PASSWORD: "{{ osp_auth_password }}"
OS_PROJECT_NAME: "admin"
OS_PROJECT_DOMAIN_ID: "{{ osp_auth_project_domain }}"
OS_USER_DOMAIN_NAME: "{{ osp_auth_user_domain }}"
tasks:
- name: Run infra-osp-project-create Role
import_role:
name: infra-osp-project-create
tags:
- infra-osp-project-create
- name: Run infra-osp-template-generate Role
import_role:
name: infra-osp-template-generate
- name: Run infra-osp-template-create Role
import_role:
name: infra-osp-template-create
- name: Step 001.2 Create Inventory and SSH config setup
hosts: localhost
connection: local
gather_facts: false
become: false
tags:
- step001
- step001.2
- create_inventory
- create_ssh_config
environment:
OS_AUTH_URL: "{{ osp_auth_url }}"
OS_USERNAME: "{{ osp_auth_username }}"
OS_PASSWORD: "{{ osp_auth_password }}"
OS_PROJECT_NAME: "{{ osp_project_name }}"
OS_PROJECT_DOMAIN_ID: "{{ osp_auth_project_domain }}"
OS_USER_DOMAIN_NAME: "{{ osp_auth_user_domain }}"
tasks:
- name: Gather instance facts
os_server_facts:
server: "*"
filters:
metadata:
guid: "{{ guid }}"
env_type: "{{ env_type }}"
register: r_osp_facts
- name: debug osp_facts
debug:
var: r_osp_facts
verbosity: 2
- name: Run infra-osp-dns Role
import_role:
name: infra-osp-dns
vars:
_dns_state: present
- name: Run infra-osp-create-inventory Role
import_role:
name: infra-osp-create-inventory
- name: Run Common SSH Config Generator Role
import_role:
name: infra-common-ssh-config-generate
# include global vars again, this time for all hosts now that the inventory is built
- import_playbook: ../include_vars.yml
tags:
- create_inventory
- must
- name: Step 001.3 Configure Linux Hosts and Wait for Connection
hosts:
- all:!windows:!network
gather_facts: false
any_errors_fatal: true
ignore_errors: false
tags:
- step001
- step001.3
- wait_ssh
tasks:
- name: set facts for remote access
tags:
- create_inventory
set_fact:
# set python interpreter: Useful when the distrib running ansible has a different path
# ex: when running using the alpine image
#ansible_python_interpreter: env python
ansible_ssh_common_args: >-
{{ ansible_ssh_extra_args|d() }}
-F {{ output_dir }}/{{ env_type }}_{{ guid }}_ssh_conf
-o ControlPath=/tmp/{{ guid }}-%r-%h-%p
- name: Run infra-osp-wait_for_linux_hosts Role
import_role:
name: infra-osp-wait_for_linux_hosts