Last active
March 28, 2021 07:18
-
-
Save gowatana/34faf19a455ef14672acc15517d1a65b to your computer and use it in GitHub Desktop.
Nutanix AHV の Custom Script(Cloud-Init)で Terraform がインストールされた VM を作成する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
disable_root: true | |
ssh_pwauth: true | |
package_upgrade: false | |
users: | |
- name: nutanix | |
lock-passwd: false | |
passwd: $6$oDzrtJla$rMzS0vuH95Q2PjDgqVOsI30MqAYemPK5Y9uYsSpeQWd99R4hqm/JWoJqH4Y81SlbtTMkglp243leccceKNZ9h. | |
sudo: ALL=(ALL) NOPASSWD:ALL | |
packages: | |
- git | |
- unzip | |
- epel-release | |
runcmd: | |
- yum install -y jq | |
- mkdir -p /home/nutanix/bin | |
- curl -LO https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_linux_amd64.zip | |
- unzip terraform_0.14.9_linux_amd64.zip -d /home/nutanix/bin/ | |
- echo 'complete -C /home/nutanix/bin/terraform terraform' >> /home/nutanix/.bashrc | |
- chown -R nutanix:nutanix /home/nutanix/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Terraform VM 作成自動化くん
Nutanix AHV の Custom Script(Cloud-Init)で Terraform がインストールされた VM を作成する。
事前準備
https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-2009.qcow2
VM 作成例
VM を作成して、パワーオンする。
IP アドレスは AOS の IPAM による DHCP 自動設定なので、下記のコマンドか Prism などから確認する。
VM が起動したら下記で SSH ログインする。
Terraform が利用可能なはず。