-2

I'm trying run below terraform script in Google Cloud.

https://github.com/terraform-google-modules/terraform-google-sap/tree/main/modules/sap_nw

The operating system I'm using is SUSE 15 SP06. Terraform script is running fine until it's trying to use "nmcli" command. "nmcli" is part of NetworkManager Package and it's not available by default in SUSE 15. So, I want to add below two commands in terraform so that they get executed right after VM creation and OS booting is completed.

sudo zypper install NetworkManager service NetworkManager restart

If you can guide me on this it would be great help.

1 Answer 1

1

Just edit the metadata field startup-script in main.tf to add the installation commands before it downloads and executes the shell script.

startup-script         = "sudo zypper install NetworkManager; service NetworkManager restart; ${local.primary_startup_url}"

You'll probably need to tweak the commands to skip interactiveness, but you get the gist.

That being said, this will be ran on every reboot, so it almost certainly makes more sense to create a custom image that has networkmanager installed and create a machine from that image.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.