https://github.com/lenisha/vsts-terraform-ansible-packer
Demo Terraform/Ansible CI/CD using VSTS
https://github.com/lenisha/vsts-terraform-ansible-packer
ansible azure packer spring-boot terraform vmss vsts
Last synced: about 2 months ago
JSON representation
Demo Terraform/Ansible CI/CD using VSTS
- Host: GitHub
- URL: https://github.com/lenisha/vsts-terraform-ansible-packer
- Owner: lenisha
- Created: 2018-04-30T19:08:56.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-13T20:09:06.000Z (over 3 years ago)
- Last Synced: 2024-10-18T06:16:04.818Z (8 months ago)
- Topics: ansible, azure, packer, spring-boot, terraform, vmss, vsts
- Language: Java
- Homepage: https://open.microsoft.com/2018/05/23/immutable-infrastructure-azure-vsts-terraform-packer-ansible/
- Size: 523 KB
- Stars: 22
- Watchers: 3
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Continuous Integration and Deployment using VSTS , Packer, Terraform and Ansible
============This repository contains code for the "Building Immutable infastructure Demo". Following is the flow:
- VSTS Build gets and packages artifacts from github
- VSTS Release invokes packer to build image from Azure Marketplace Ubuntu image and save into ManagedDisk
- Packer uses `ansible-local` provisioner to install Apache and application code into the image
- VSTS Release invokes Terraform to provision Infrastructure (VMSS, LB, NSG) and point VMSS to image stored by packaer in ManagedDisks
## Packer
Packer template for Azure Image is located at `packer/app.json`. It stores prepared image in managed disks in Resource group provided by environment variable `ARM_RESOURCE_GROUP_DISKS`, this resource group should be created before the build (TODO: add creation to pipeline)Packer will invoke `ansible-local` provisioner that will copy required files and invoke `apache.yml` Ansible playbook
## Ansible
Ansible playbook`packer/apache.yml` installs and congigures Apache and copies application files (HTMLs, Images)
(TODO: wire more sophisticated playbook)## Terraform
Terraform template is located at `terraform/azure`. It creates VM Scale Set based on Packer prepared imagestored in Managed disks
VSTS uses Azure Storage backend to store state file. Storrge account and Container should be created before staring the build. (Defaults are in backend.tfvars)