blob: 64ca15a68433ee434a8e7038667472c2fddf3905 (
plain)
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
|
- name: Set some facts
set_fact:
ands_host_id: "{{ ands_host_id }}"
- name: Set network facts
set_fact:
ands_cluster_domain: "{{ ands_cluster_domain }}"
ands_cluster_dot_domain: ".{{ ands_cluster_domain }}"
ands_inner_domain: "{{ ands_inner_domain }}"
ands_inner_dot_domain: "{{ (ands_inner_domain == ands_none) | ternary('', '.' ~ ands_inner_domain) }}"
ands_inner_lb: "{{ ands_inner_lb }}"
ands_use_inner_lb: "{{ ands_use_inner_lb }}"
ands_inner_lb_ip: "{{ ands_openshift_network | ipaddr(ands_inner_lb_id) | ipaddr('address') }}"
ands_inner_lb_hostname: "{{ ands_inner_lb_hostname }}"
ands_openshift_cidr: "{{ ands_openshift_network | ipaddr(ands_host_id) }}"
ands_openshift_ip: "{{ ands_openshift_network | ipaddr(ands_host_id) | ipaddr('address') }}"
ands_openshift_hostname: "{{ ands_openshift_hostname | default(ands_openshift_default_hostname) }}"
ands_openshift_public_cidr: "{{ (ands_openshift_public_network is defined) | ternary( ands_openshift_public_network | ipaddr(ands_host_id), ands_openshift_default_cidr) }}"
ands_openshift_public_ip: "{{ (ands_openshift_public_network is defined) | ternary( ands_openshift_public_network | ipaddr(ands_host_id) | ipaddr('address'), ands_openshift_default_ip) }}"
ands_openshift_public_hostname: "{{ ands_openshift_public_hostname | default(ands_openshift_default_hostname) }}"
ands_storage_cidr: "{{ ands_storage_network | default(ands_openshift_network) | ipaddr(ands_host_id) }}"
ands_storage_ip: "{{ ands_storage_network | default(ands_openshift_network) | ipaddr(ands_host_id) | ipaddr('address') }}"
ands_hostname_public: "ands_public{{ ands_host_id }}"
ands_hostname_storage: "ands_storage{{ ands_host_id }}"
ands_hostname_openshift: "ands_openshift{{ ands_host_id }}"
ands_openshift_set_hostname: "{{ ands_openshift_set_hostname }}"
ands_openshift_set_public_hostname: "{{ ands_openshift_set_public_hostname }}"
ands_storage_hostname: "{{ ands_storage_hostname }}"
- name: Set more network facts
set_fact:
ands_openshift_public_fqdn: "{{ (ands_openshift_public_hostname == ands_none) | ternary(ands_none, ands_openshift_public_hostname ~ ands_cluster_dot_domain ) }}"
ands_openshift_fqdn: "{{ (ands_openshift_hostname == ands_none) | ternary(ands_none, ands_openshift_hostname ~ ands_inner_dot_domain ) }}"
ands_inner_lb_fqdn: "{{ ands_inner_lb_hostname ~ ands_inner_dot_domain }}"
ands_storage_servers: "{{ ands_storage_servers }}"
- name: "Detect inner network interface"
include_tasks: "find_interface_by_ip.yml"
vars:
var: "ands_inner_interface"
ip: "{{ ands_openshift_ip }}"
when:
- ands_inner_interface is not defined
- name: "Detect public network interface (using public ip)"
include_tasks: "find_interface_by_ip.yml"
vars:
var: "ands_public_interface"
ip: "{{ (ands_openshift_public_ip == ands_none) | ternary(ands_default_ip, ands_openshift_public_ip) }}"
when:
- ands_public_interface is not defined
- name: "Detect public network interface (using global network)"
include_tasks: "find_interface_by_net.yml"
vars:
var: "ands_public_interface"
net: "{{ ands_global_network }}"
when:
- ands_public_interface is not defined
- ands_global_network is defined
- name: Set ipfailover inner interface
set_fact:
ands_ipfailover_inner_interface: "{{ ands_inner_interface }}"
when: ands_ipfailover_inner_interface is not defined
- name: Set ipfailover interface
set_fact:
ands_ipfailover_interface: "{{ ands_public_interface }}"
when: ands_ipfailover_interface is not defined
#- debug: msg="{{ hostvars }}"
|