Skip to content

Commit

Permalink
OCTOPUS-473: modified the resolv to disable networkmanager management…
Browse files Browse the repository at this point in the history
… of the etc resolv

Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
  • Loading branch information
prb112 committed Oct 25, 2023
1 parent 760a74a commit 3055157
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ module "support" {
bastion_public_ip = var.powervs_bastion_ip
cidrs = module.vpc_prepare.mac_vpc_subnets
powervs_machine_cidr = var.powervs_machine_cidr
ibmcloud_api_key = var.ibmcloud_api_key
vpc_name = var.vpc_name
vpc_region = var.vpc_region
resource_group = module.vpc.vpc_resource_group
ignition_ip = var.powervs_bastion_private_ip
}

module "image" {
Expand Down
7 changes: 7 additions & 0 deletions modules/4_pvs_support/files/resolv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ storage:
inline: |
search $(hostname --long)
nameserver $(hostname -i | awk '{print $NF}')
- path: /etc/NetworkManager/conf.d/90-dns-none.conf
overwrite: true
mode: 0644
contents:
inline: |
[main]
dns=none
EOF

chmod +x butane
Expand Down
42 changes: 40 additions & 2 deletions modules/4_pvs_support/pvs_support.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ EOF
}

resource "null_resource" "migrate_mcp" {
depends_on = [null_resource.create_resolv_conf_for_intel_workers]
depends_on = [null_resource.limit_csi_arch]
connection {
type = "ssh"
user = var.rhel_username
Expand Down Expand Up @@ -267,7 +267,7 @@ EOF

# Dev Note: do this as the last step so we get a good worker ignition file downloaded.
resource "null_resource" "latest_ignition" {
# depends_on = [null_resource.wait_on_mcp]
# depends_on = [null_resource.wait_on_mcp]
depends_on = [null_resource.set_routing_via_host]
connection {
type = "ssh"
Expand All @@ -288,3 +288,41 @@ EOF
]
}
}

# # Dev Note: create the dns lookup
# resource "null_resource" "update_dns_resolver_for_vpc" {
# # depends_on = [null_resource.wait_on_mcp]
# depends_on = [null_resource.latest_ignition]
# connection {
# type = "ssh"
# user = var.rhel_username
# host = var.bastion_public_ip
# private_key = file(var.private_key_file)
# agent = var.ssh_agent
# timeout = "${var.connection_timeout}m"
# }

# provisioner "remote-exec" {
# inline = [<<EOF
# if [ -z "$(command -v ibmcloud)" ]
# then
# echo "ibmcloud CLI doesn't exist, installing"
# curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
# fi

# ibmcloud login --apikey "${var.ibmcloud_api_key}" -r "${var.vpc_region}" -g "${var.resource_group}"
# ibmcloud plugin install -f cloud-internet-services vpc-infrastructure cloud-object-storage power-iaas is

# export IBMCLOUD_IS_FEATURE_VPC_DNS_SHARING=true
# ibmcloud is vpcu ${var.vpc_name} --dns-enable-hub true --dns-resolver-type manual --dns-resolver-manual-servers '[
# {
# "address": "${var.ignition_ip}"
# }
# ]'

# echo "waiting to reconcile the status"
# sleep 60
# EOF
# ]
# }
# }
5 changes: 5 additions & 0 deletions modules/4_pvs_support/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ variable "bastion_public_ip" {}
variable "private_key_file" {}
variable "connection_timeout" {}
variable "rhel_username" {}
variable "ignition_ip" {}
variable "ibmcloud_api_key" {}
variable "vpc_name" {}
variable "vpc_region" {}
variable "resource_group" {}

0 comments on commit 3055157

Please sign in to comment.