Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.sh missing error #11

Open
vinotpal opened this issue Aug 24, 2022 · 0 comments
Open

setup.sh missing error #11

vinotpal opened this issue Aug 24, 2022 · 0 comments

Comments

@vinotpal
Copy link

Have performed all the pre-requisites required for the running the "terraform apply", which I have checked upon.
But, if when performed terraform apply (after terraform init and terraform plan), get the below error.

module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0]: Still creating... [30s elapsed]
module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0]: Still creating... [40s elapsed]
module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0]: Still creating... [50s elapsed]
module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0]: Still creating... [1m0s elapsed]
module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0]: Still creating... [1m10s elapsed]
module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0]: Still creating... [1m20s elapsed]
module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0] (remote-exec): chmod: cannot access ‘/home/opc/setup.sh’: No such file or directory
module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0] (remote-exec): sudo: /home/opc/setup.sh: command not found

│ Error: remote-exec provisioner error

│ with module.jenkins.module.jenkins-controller.null_resource.TFJenkinsControllerConfig_via_bastion[0],
│ on .terraform/modules/jenkins/modules/jenkins-controller/main.tf line 216, in resource "null_resource" "TFJenkinsControllerConfig_via_bastion":
│ 216: provisioner "remote-exec" {

│ error executing "/tmp/terraform_1398496185.sh": Process exited with status 1

The error seems to be from below section of code:
provisioner "remote-exec" {
connection {
host = oci_core_instance.TFJenkinsController.public_ip
agent = false
timeout = "5m"
user = var.vm_user
private_key = var.ssh_private_key
}

inline = [
  "sleep 60",
  "chmod +x ~/setup.sh",
  "sudo ~/setup.sh",
]

}

provisioner "remote-exec" {
connection {
host = oci_core_instance.TFJenkinsController.private_ip
agent = false
timeout = "5m"
user = var.vm_user
private_key = var.ssh_private_key

  bastion_host        = var.use_bastion_service ? "host.bastion.${var.bastion_service_region}.oci.oraclecloud.com" : var.bastion_host
  bastion_user        = var.use_bastion_service ? oci_bastion_session.ssh_via_bastion_service[0].id : var.bastion_user
  bastion_private_key = var.bastion_private_key
}

inline = [
  "sleep 60",
  "chmod +x ~/setup.sh",
  "sudo ~/setup.sh",
]

}

Is this something caused due to misconfiguration from my side?

NOTE: If removed the above two lines from the provisioner "remote-exec" inline code section from:
.terraform/modules/jenkins/modules/jenkins-controller/main.tf

can proceed further with process, but certainly the Jenkins and OCI setup and configuration seems to be missing on the VM/Nodes provisioned through terraform automated scripts.

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

No branches or pull requests

1 participant