Skip to content

Comments

Add variable to specify the bastion host#395

Draft
etiennedub wants to merge 2 commits intoComputeCanada:mainfrom
etiennedub:bastion
Draft

Add variable to specify the bastion host#395
etiennedub wants to merge 2 commits intoComputeCanada:mainfrom
etiennedub:bastion

Conversation

@etiennedub
Copy link
Contributor

Add a variable to specify the bastion host with Incus.

This is useful when deploying remotely and use the Incus and Terraform are not running on the same host. You can use the Incus host as bastion for the provisioning.

@etiennedub etiennedub marked this pull request as draft January 20, 2026 14:04
@cmd-ntrf
Copy link
Member

cmd-ntrf commented Feb 12, 2026

The scope of the bastion_host does not have to be limited.

variable "bastion_remote" should be moved from incus/variables.tf to common/variables.tf. We would also need to add bastion_remote = var.bastion_remote to the module "provision" of each cloud provider.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file appear unnecessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file appear unnecessary.

variable "puppetfile" {}

variable "bastion_remote" {
default = {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No default value if we move th variable bastion_remote from incus/incus.tf to common/variables.tf.

node = { type = "container", cpus = 2, ram = 3000, gpus = 0, tags = ["node"], count = 1 }
}

firewall_rules = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the firewall rules

http = { "from_port" = 80, "to_port" = 80, tag = "proxy", "cidr" = "0.0.0.0/0" },
https = { "from_port" = 443, "to_port" = 443, tag = "proxy", "cidr" = "0.0.0.0/0" },
}
bastion_tags = ["login"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the bastion_tags

# }

# Use the local ip as bastion (when deploying Terraform directly from the Incus host)
bastion_remote = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSH-ing to self first before connecting to the puppetserver appears to be useless, but I could be wrong.

# data "http" "agent_ip" {
# url = "http://ipv4.icanhazip.com"
# }
data "http" "agent_ip" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it commented.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to common/variables.tf

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replicate this in aws/infrastructure.tf, azure/infrastructure.tf, gcp/infrastructure.tf, openstack/infrastructure.tf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants