Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Remove warnings #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ resource "aws_security_group_rule" "bastion_egress_all" {
}

resource "aws_instance" "bastion" {
ami = "${data.aws_ami.ubuntu.id}"
ami = data.aws_ami.ubuntu.id
instance_type = "t2.micro"
subnet_id = element(module.vpc.public_subnets, 0)
user_data = templatefile("${path.module}/bastion.tmpl", { ssh_keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5O7k6gRYCU7YPkCH6dyXVW10izMAkDAQtQxNxdRE22 drpebcak"] })
Expand Down Expand Up @@ -121,7 +121,7 @@ module "k3s_rancher" {
private_subnets_cidr_blocks = module.vpc.private_subnets_cidr_blocks
registration_command = rancher2_cluster.k3s.cluster_registration_token[0].command
providers = {
aws = "aws"
aws.r53 = "aws.r53"
aws = aws
aws.r53 = aws.r53
}
}
6 changes: 3 additions & 3 deletions examples/rancher/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ resource "aws_security_group_rule" "bastion_egress_all" {
}

resource "aws_instance" "bastion" {
ami = "${data.aws_ami.ubuntu.id}"
ami = data.aws_ami.ubuntu.id
instance_type = "t2.micro"
subnet_id = element(module.vpc.public_subnets, 0)
user_data = templatefile("${path.module}/bastion.tmpl", { ssh_keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5O7k6gRYCU7YPkCH6dyXVW10izMAkDAQtQxNxdRE22 drpebcak"] })
Expand Down Expand Up @@ -116,7 +116,7 @@ module "k3s_rancher" {
extra_agent_security_groups = [module.vpc.default_security_group_id]
private_subnets_cidr_blocks = module.vpc.private_subnets_cidr_blocks
providers = {
aws = "aws"
aws.r53 = "aws.r53"
aws = aws
aws.r53 = aws.r53
}
}
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ provider "rancher2" {
alias = "bootstrap"
api_url = "https://${local.name}.${local.domain}"
bootstrap = true
insecure = true
}

resource "null_resource" "wait_for_rancher" {
count = local.install_rancher ? 1 : 0
provisioner "local-exec" {
command = <<EOF
while [ "$${subject}" != "* subject: CN=$${RANCHER_HOSTNAME}" ]; do
while [ "$${subject}" != "* subject: O=cert-manager; CN=$${RANCHER_HOSTNAME}" ]; do
subject=$(curl -vk -m 2 "https://$${RANCHER_HOSTNAME}/ping" 2>&1 | grep "subject:")
echo "Cert Subject Response: $${subject}"
if [ "$${subject}" != "* subject: CN=$${RANCHER_HOSTNAME}" ]; then
if [ "$${subject}" != "* subject: O=cert-manager; CN=$${RANCHER_HOSTNAME}" ]; then
sleep 10
fi
done
Expand Down