-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
67 lines (66 loc) · 2.34 KB
/
site.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
# (c) 2016 DataNexus Inc. All Rights Reserved
---
# First, build our application host group
- name: Create application host group
hosts: "{{host_inventory}}"
gather_facts: no
tasks:
- include_role:
name: build-app-host-groups
vars:
host_group_list:
- name: "{{application}}"
when: inventory_type == 'dynamic'
- include_role:
name: build-app-host-groups
vars:
host_group_list:
- { name: "{{application}}", node_list: "{{host_inventory}}" }
when: inventory_type == 'static'
# Then, deploy our application to the nodes in the application host group
- name: Install application on the selected server(s)
hosts: "{{application}}:&{{application}}_nodes"
gather_facts: no
vars_files:
- "vars/{{application | default('app-install')}}.yml"
vars:
- combined_package_list: "{{ (default_packages|default([])) | union(application_package_list|default([])) | union((install_packages_by_tag|default({})).application|default([])) }}"
pre_tasks:
- name: Ensure the network interfaces are up on our application node(s)
service:
name: network
state: restarted
become: true
when: not (skip_network_restart is defined or skip_network_restart)
- name: Gather facts from the application node(s)
setup:
- include_role:
name: setup-web-proxy
- include_role:
name: add-local-repository
vars:
yum_repository: "{{yum_repo_url}}"
when: yum_repo_url is defined or (reset_mirrors is defined and reset_mirrors)
- block:
- include_role:
name: install-packages
vars:
package_list: ["epel-release"]
- include_role:
name: add-local-repository
vars:
yum_repository: "{{epel_repo_url}}"
repository_name: epel
regex_repl_vals:
baseurl:
regex: '^#?(baseurl=)(http[s]?://[^\/]+\/[^0-9]*)(\/.*)$'
replx: "\\g<1>{{yum_repository}}\\g<3>"
mirrorlist:
regex: "^(mirrorlist=http[s]?://mirrors.fedoraproject.org/.*)$"
replx: "#\\g<1>"
when: epel_repo_url is defined or (reset_mirrors is defined and reset_mirrors)
when: add_epel_repo
roles:
- role: install-packages
package_list: "{{combined_package_list}}"
- role: dn-app-install