-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,097 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ global_settings: | |
- key: "Module" | ||
value: "easy-imm" | ||
- key: "Version" | ||
value: "4.2.11-18370" | ||
value: "4.2.11-18371" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
#======================================== | ||
# Global Settings | ||
#======================================== | ||
global_settings: | ||
intersight_fqdn: intersight.com | ||
tags: | ||
- key: "Module" | ||
value: "easy-imm" | ||
- key: "Version" | ||
value: "4.2.11-18370" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
locals { | ||
global_settings = { | ||
tags = lookup(local.model.global_settings, "tags", [ | ||
{ | ||
key = "Module" | ||
value = "terraform-intersight-easy-imm" | ||
}, | ||
{ | ||
key = "Version" | ||
value = "4.2.11-18370" | ||
} | ||
]) | ||
} | ||
intersight_fqdn = lookup(local.model.global_settings, "intersight_fqdn", "intersight.com") | ||
non_orgs = ["global_settings", "intersight"] | ||
model = yamldecode(data.utils_yaml_merge.model.output) | ||
orgs = { for k, v in data.intersight_organization_organization.orgs.results : v.name => v.moid } | ||
|
||
#__________________________________________________________________ | ||
# | ||
# Sensitive Variables | ||
#__________________________________________________________________ | ||
policies_sensitive = { | ||
certificate_management = { | ||
certificate = { | ||
1 = fileexists(var.cert_mgmt_certificate_1) ? file(var.cert_mgmt_certificate_1) : var.cert_mgmt_certificate_1 | ||
2 = fileexists(var.cert_mgmt_certificate_2) ? file(var.cert_mgmt_certificate_2) : var.cert_mgmt_certificate_2 | ||
3 = fileexists(var.cert_mgmt_certificate_3) ? file(var.cert_mgmt_certificate_3) : var.cert_mgmt_certificate_3 | ||
4 = fileexists(var.cert_mgmt_certificate_4) ? file(var.cert_mgmt_certificate_4) : var.cert_mgmt_certificate_4 | ||
5 = fileexists(var.cert_mgmt_certificate_5) ? file(var.cert_mgmt_certificate_5) : var.cert_mgmt_certificate_5 | ||
} | ||
private_key = { | ||
1 = fileexists(var.cert_mgmt_private_key_1) ? file(var.cert_mgmt_private_key_1) : var.cert_mgmt_private_key_1 | ||
2 = fileexists(var.cert_mgmt_private_key_2) ? file(var.cert_mgmt_private_key_2) : var.cert_mgmt_private_key_2 | ||
3 = fileexists(var.cert_mgmt_private_key_3) ? file(var.cert_mgmt_private_key_3) : var.cert_mgmt_private_key_3 | ||
4 = fileexists(var.cert_mgmt_private_key_4) ? file(var.cert_mgmt_private_key_4) : var.cert_mgmt_private_key_4 | ||
5 = fileexists(var.cert_mgmt_private_key_5) ? file(var.cert_mgmt_private_key_5) : var.cert_mgmt_private_key_5 | ||
} | ||
} | ||
drive_security = { | ||
current_security_key_passphrase = { | ||
1 = var.drive_security_current_security_key_passphrase | ||
} | ||
new_security_key_passphrase = { | ||
1 = var.drive_security_new_security_key_passphrase | ||
} | ||
password = { | ||
1 = var.drive_security_authentication_password | ||
} | ||
server_public_root_ca_certificate = { | ||
1 = fileexists(var.drive_security_server_ca_certificate | ||
) ? file(var.drive_security_server_ca_certificate) : var.drive_security_server_ca_certificate | ||
} | ||
} | ||
firmware = { | ||
cco_password = { 1 = var.cco_password } | ||
cco_user = { 1 = var.cco_user } | ||
} | ||
ipmi_over_lan = { encryption_key = { 1 = var.ipmi_encryption_key } } | ||
iscsi_boot = { password = { 1 = var.iscsi_boot_password } } | ||
ldap = { password = { 1 = var.binding_parameters_password } } | ||
local_user = { | ||
password = { | ||
1 = var.local_user_password_1 | ||
2 = var.local_user_password_2 | ||
3 = var.local_user_password_3 | ||
4 = var.local_user_password_4 | ||
5 = var.local_user_password_5 | ||
} | ||
} | ||
persistent_memory = { passphrase = { 1 = var.persistent_passphrase } } | ||
snmp = { | ||
access_community_string = { | ||
1 = var.access_community_string_1 | ||
2 = var.access_community_string_2 | ||
3 = var.access_community_string_3 | ||
4 = var.access_community_string_4 | ||
5 = var.access_community_string_5 | ||
} | ||
auth_password = { | ||
1 = var.snmp_auth_password_1 | ||
2 = var.snmp_auth_password_2 | ||
3 = var.snmp_auth_password_3 | ||
4 = var.snmp_auth_password_4 | ||
5 = var.snmp_auth_password_5 | ||
} | ||
privacy_password = { | ||
1 = var.snmp_privacy_password_1 | ||
2 = var.snmp_privacy_password_2 | ||
3 = var.snmp_privacy_password_3 | ||
4 = var.snmp_privacy_password_4 | ||
5 = var.snmp_privacy_password_5 | ||
} | ||
trap_community_string = { | ||
1 = var.snmp_trap_community_1 | ||
2 = var.snmp_trap_community_2 | ||
3 = var.snmp_trap_community_3 | ||
4 = var.snmp_trap_community_4 | ||
5 = var.snmp_trap_community_5 | ||
} | ||
} | ||
virtual_media = { | ||
password = { | ||
1 = var.vmedia_password_1 | ||
2 = var.vmedia_password_2 | ||
3 = var.vmedia_password_3 | ||
4 = var.vmedia_password_4 | ||
5 = var.vmedia_password_5 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#_________________________________________________________________________________________ | ||
# | ||
# Data Model Merge Process - Merge YAML Files into HCL Format | ||
#_________________________________________________________________________________________ | ||
data "intersight_organization_organization" "orgs" {} | ||
data "utils_yaml_merge" "model" { | ||
input = concat([ | ||
for file in fileset(path.module, "*.ezi.yaml") : file(file)], [ | ||
for file in fileset(path.module, "p*/*.ezi.yaml") : file(file)], [ | ||
for file in fileset(path.module, "t*/*.ezi.yaml") : file(file)] | ||
) | ||
merge_list_items = false | ||
} | ||
|
||
#_________________________________________________________________________________________ | ||
# | ||
# Intersight:Pools | ||
# GUI Location: Infrastructure Service > Configure > Pools | ||
#_________________________________________________________________________________________ | ||
module "pools" { | ||
# source = "/home/tyscott/terraform-cisco-modules/terraform-intersight-pools" | ||
source = "terraform-cisco-modules/pools/intersight" | ||
version = "4.2.11-16711" | ||
for_each = { | ||
for i in ["map"] : i => i if length(flatten([for org in setsubtract(keys(local.model), local.non_orgs) : [ | ||
for e in keys(lookup(local.model[org], "pools", {})) : e]])) > 0 || length( | ||
flatten([for org in setsubtract(keys(local.model), local.non_orgs) : [for e in lookup(lookup(local.model[org], "profiles", {}), "server", []) : [ | ||
for d in e["targets"] : lookup(d, "reservations", []) | ||
]]]) | ||
) > 0 | ||
} | ||
global_settings = local.global_settings | ||
model = { for k, v in local.model : k => v if length(regexall("^global_settings|intersight$", k)) == 0 } | ||
orgs = local.orgs | ||
} | ||
|
||
#_________________________________________________________________________________________ | ||
# | ||
# Intersight:Policies | ||
# GUI Location: Infrastructure Service > Configure > Policies | ||
#_________________________________________________________________________________________ | ||
module "policies" { | ||
# source = "/home/tyscott/terraform-cisco-modules/terraform-intersight-policies" | ||
source = "terraform-cisco-modules/policies/intersight" | ||
version = "4.2.11-16711" | ||
for_each = { | ||
for i in ["map"] : i => i if length(flatten([for org in keys(local.model) : [ | ||
for e in keys(lookup(local.model[org], "policies", {})) : local.model[org].policies[e] if length(lookup(lookup( | ||
local.model[org], "policies", {}), e, [])) > 0]]) | ||
) > 0 | ||
} | ||
global_settings = local.global_settings | ||
model = { for k, v in local.model : k => v if length(regexall("^global_settings|intersight$", k)) == 0 } | ||
orgs = local.orgs | ||
policies_sensitive = local.policies_sensitive | ||
pools = module.pools | ||
} | ||
|
||
#_________________________________________________________________________________________ | ||
# | ||
# Intersight:UCS Chassis and Server Profiles | ||
# GUI Location: Infrastructure Service > Configure > Profiles | ||
#_________________________________________________________________________________________ | ||
module "profiles" { | ||
# source = "/home/tyscott/terraform-cisco-modules/terraform-intersight-profiles" | ||
source = "terraform-cisco-modules/profiles/intersight" | ||
version = "4.2.11-16711" | ||
for_each = { | ||
for i in ["map"] : i => i if length(flatten([for org in keys(local.model) : [for e in ["profiles", "templates"] : [ | ||
for d in ["chassis", "domain", "server"] : lookup(lookup(local.model[org], e, {}), d, [])]]] | ||
)) > 0 | ||
} | ||
global_settings = local.global_settings | ||
model = { for k, v in local.model : k => v if length(regexall("^global_settings|intersight$", k)) == 0 } | ||
orgs = local.orgs | ||
policies = module.policies | ||
pools = module.pools | ||
} |
Oops, something went wrong.