This is my home environment.
| Software | Version | Description |
|---|---|---|
| ESXi | >= 7.0 | |
| VMware Ovf Tool | >= 4.3 | |
| python | >= 3.7 | |
| packer | >= 1.7 | |
| terraform | >= 0.15 | |
| ansible | >= 3.3 | |
| rke | >= 1.2 | |
| vagrant | >= 2.2 | Optional |
- Enable Access to the ESXi Shell via SSH.
- Enable GuestIPHack.
esxcli system settings advanced set -o /Net/GuestIPHack -i 1
git clone git@github.com:ymmmtym/home.git
cd homecreate .env for your environment.
and source .env
cp .sample.env .env
vi .env
. .envgrep -r "ANSIBLE_VAULT" inventories/*echo "<your vault password>" > .vault_password
ansible-vault encrypt ${YOUR_SECRET_FILE_PATH}See inventories directory recursively.
Then, fix inventories/base.yml and group_vars, host_vars for your environment.
Create terraform/terraform.tfvars like following text.
ESXI_HOSTNAME = "<IP Address of your ESXi>"
ESXI_USERNAME = "<Username for ESXi login>"
ESXI_PASSWORD = "<Password for ESXi login>"Fix packer/vairables.json for your environment.
Exec following command at current directory.
packer build packer/templates.json -var-file=packer/variables.jsonIf you want more template images, you need to add template config to packer/templates.json.
Activate ansible environment.
ex)
python3 -m venv --clear .venv
. .venv/bin/activate
pip install -r requirements.txtAdd route to public network.
ip r add 192.168.100.0/24 via 192.168.0.4Exec terraform apply.
cd terraform
terraform apply