SMALL
variable "admin_password" {
description = "Admin user password for SSH connection"
type = string
default = "패스워드"
}
variable "host" {
description = "Target host for remote connection"
type = string
default = "192.168.99.43"
}
resource "null_resource" "test" {
provisioner "file" {
source = "${path.module}/showip.bat"
destination = "C:/Temp/showip.bat"
}
provisioner "remote-exec" {
inline = [
"cmd.exe /c C:/Temp/showip.bat"
]
}
connection {
type = "ssh"
user = "admin"
password = var.admin_password
host = var.host
timeout = "2m"
target_platform = "windows"
}
}

취약점 보안 검사 스크립트 돌릴때,
호스트 IP 랑 패스워드를 좀 암호화 하여 리스트 형식으로 만들면 조금 더 편리 하겠네요.
LIST
'IT > 기타' 카테고리의 다른 글
Terraform 윈도우 LOG 변수 설정 (0) | 2025.03.06 |
---|---|
Jenkins 내부->외부 포트포워딩 (0) | 2025.03.02 |
Jenkins Pipeline (선언형,스크립트형 테스트) (0) | 2025.02.26 |
Jenkins 파이프라인 이메일 테스트 (0) | 2025.02.26 |
Jenkins SSH 자격 인증 생성 (0) | 2025.02.26 |