This is a basic terraform script which deploying Ubuntu based and setting up vsftpd server VM.
This script was written for vDirector which has two VDC, first uses for network resources (vdc_service), second uses for compute, storage resources (vdc_standard).
- Linux based OS or Windows
- vDirector v.10
- Terraform (>=0.14)
- Administrator acces into vDirector
- Ansible >=2.10
- Create vApp
- Create VM
- Create routed network (NSX Edge)
- Create FW, SNAT, DNAT rules
- Create and attach to VM independed Disk
- Setting up nameservers
- Update system
- Create users (ftpuser)
- Create disk 3.1 Create GPT disk 3.2 Create LVM Group 3.3 Create LVM Volume 3.4 Make fs 3.5 Add info to fstab
- Install server vsftpd with default tls key
- Send ssh key to server
- Clone this repo
- Initialize plugins
terraform init
-
Edit varriables.tf according to your values
-
Edit terraform.tfvars according to your credentials
-
Check all config
terraform plan
If all is ok 6. Deploy VM
terraform apply
To show VM password type
terraform outpus pass_vm
First replace ftp_rsa.pub with your key roles/install_vsftpd/files
check playbook
ansible-playbook -i inventory.ini ftp.yml --extra-vars "ansible_user=root ansible_password=your_vm_pass" --ssh-common-args='-o StrictHostKeyChecking=no' --check
run playbook
ansible-playbook -i inventory.ini ftp.yml --extra-vars "ansible_user=root ansible_password=your_vm_pass" --ssh-common-args='-o StrictHostKeyChecking=no'
ssh port =22
GNU GPL v3