forked from ansible-lockdown/RHEL9-CIS
added new connection and provate key vars
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
125566fcf2
commit
15a46f25a8
2 changed files with 15 additions and 0 deletions
1
.github/workflows/github_vars.tfvars
vendored
1
.github/workflows/github_vars.tfvars
vendored
|
|
@ -7,6 +7,7 @@ namespace = "github_actions"
|
|||
|
||||
// Matching pair name found in AWS for keypairs PEM key
|
||||
ami_key_pair_name = "github_actions"
|
||||
private_key = ".ssh/github_actions.pem"
|
||||
main_vpc_cidr = "172.22.0.0/24"
|
||||
public_subnets = "172.22.0.128/26"
|
||||
private_subnets = "172.22.0.192/26"
|
||||
14
.github/workflows/main.tf
vendored
14
.github/workflows/main.tf
vendored
|
|
@ -59,6 +59,20 @@ resource "aws_instance" "testing_vm" {
|
|||
root_block_device {
|
||||
delete_on_termination = true
|
||||
}
|
||||
# SSH into instance - will ensure server is up before next step in workflows
|
||||
connection {
|
||||
# Host name
|
||||
host = self.public_ip
|
||||
# The default username for our AMI
|
||||
user = var.ami_username
|
||||
# Private key for connection
|
||||
private_key = "${file(var.private_key)}"
|
||||
# Type of connection
|
||||
type = "ssh"
|
||||
}
|
||||
provisioner "remote-exec" {
|
||||
inline = [ "echo hello_world"]
|
||||
}
|
||||
}
|
||||
|
||||
// generate inventory file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue