forked from citrix/terraform-provider-citrixadc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresources.tf
85 lines (58 loc) · 1.93 KB
/
resources.tf
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
locals {
do_install = ( data.citrixadc_nsversion.nsversion.version != "Netscaler NS13.1: Build 17.42.nc" )
}
data "citrixadc_nsversion" "nsversion" {
provider = citrixadc.primary
installedversion = true
}
resource "citrixadc_hafailover" "ensure_secondary_is_secondary" {
provider = citrixadc.secondary
ipaddress = var.secondary_nsip
state = "Secondary"
force = true
count = local.do_install ? 1 : 0
}
resource "citrixadc_installer" "tf_installer_secondary" {
provider = citrixadc.secondary
url = "file:///var/tmp/build_artesa_17_42_nc_64.tgz"
y = true
l = false
wait_until_reachable = true
depends_on = [citrixadc_hafailover.ensure_secondary_is_secondary]
count = local.do_install ? 1 : 0
}
resource "time_sleep" "wait_for_secondary_nitro" {
create_duration = "120s"
depends_on = [citrixadc_installer.tf_installer_secondary]
count = local.do_install ? 1 : 0
}
resource "citrixadc_hafailover" "ensure_secondary_is_primary" {
provider = citrixadc.secondary
ipaddress = var.secondary_nsip
state = "Primary"
force = true
depends_on = [time_sleep.wait_for_secondary_nitro]
count = local.do_install ? 1 : 0
}
resource "citrixadc_installer" "tf_installer_primary" {
provider = citrixadc.primary
url = "file:///var/tmp/build_artesa_17_42_nc_64.tgz"
y = true
l = false
wait_until_reachable = true
depends_on = [citrixadc_hafailover.ensure_secondary_is_primary]
count = local.do_install ? 1 : 0
}
resource "time_sleep" "wait_for_primary_nitro" {
create_duration = "120s"
depends_on = [citrixadc_installer.tf_installer_primary]
count = local.do_install ? 1 : 0
}
resource "citrixadc_hafailover" "ensure_primary_is_primary" {
provider = citrixadc.primary
ipaddress = var.primary_nsip
state = "Primary"
force = true
depends_on = [time_sleep.wait_for_primary_nitro]
count = local.do_install ? 1 : 0
}