forked from ansible-lockdown/RHEL9-CIS
added new ssh connection
This commit is contained in:
parent
32ce7b569f
commit
78116ee738
1 changed files with 14 additions and 0 deletions
14
.github/workflows/main.tf
vendored
14
.github/workflows/main.tf
vendored
|
|
@ -59,6 +59,20 @@ resource "aws_instance" "testing_vm" {
|
||||||
root_block_device {
|
root_block_device {
|
||||||
delete_on_termination = true
|
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
|
// generate inventory file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue