sparse-intern-71089
02/02/2022, 10:21 AMprehistoric-activity-61023
02/02/2022, 10:59 AMbrainy-window-77332
02/02/2022, 11:44 AMbrainy-window-77332
02/02/2022, 11:44 AMnetwork_interfaces = {}
for (group_name, group_config, role_name, role_info) in process_nodes(cfg):
for index, network_interface in enumerate(role_info["node_list"]):
network_interfaces[f"{cfg.stack}-{group_name}-{role_name}-{index}"] = network_interface
config = get_full_config(cfg)
ghe_ha_config_bucket_object = aws.s3.BucketObject(
"ghe-ha-config-bucket-object",
bucket=config_bucket.id,
content=Output.from_input(network_interfaces).apply(update_config(config, network_interfaces)),
opts=pulumi.ResourceOptions(depends_on=network_interfaces.values()),
)
brainy-window-77332
02/02/2022, 11:45 AMdef update_config(config: str, network_interfaces):
for name, network_interface in network_interfaces.items():
value = network_interface.private_ips[0]
config = config.replace(f"{name}-ipv4_address", value, 1)
print(f"{get_caller()} - config: {config}")
brainy-window-77332
02/02/2022, 11:46 AM