Skip to content

Automatic deployment of cloud infrastructure and LAMP application stack using Ansible and Azure DevOps CI

License

Notifications You must be signed in to change notification settings

Better-Computing-Consulting/azure-devops-ci-ansible-lamp-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

azure-devops-ci-ansible-lamp-deployment

Automatic deployment of cloud infrastructure and LAMP application stack using Ansible and Azure DevOps CI

  • logon to https://dev.azure.com/

  • Create DevOps project

  • Create Service Connection of the type Azure Resource Manager using "Service Principal (manual)" with the same name as in azure-pipelines.yml line 17. Use the following Azure CLI commands to get the information for the Service Connection:

    • az account subscription list (for subscription id and name)
    • az account show (for tenantid)
    • az ad sp create-for-rbac --name your-sp-name (for Service Principal Id [appid] and Service Principal Key [password])
  • Create a Pipeline pointing to your clone of this repository and save it.

  • At a git prompt run git commit --allow-empty -m "trigger ci" and git push origin master to trigger the Azure DevOps Pipeline CI and deploy the cloud infrastructure and LAMP application stack.

During the execution of the playbooks you can follow the changes on Azure with CLI command for example,

  • az vm list
  • az network nsg list
  • az network nsg rule list
  • az network public-ip list

After initial deployment you can further customize the infrastructure or the LAMP stack by commiting your changes to the code.

There is a blog that explains with details some aspects of the playblooks, such as how ssh key authentication is handled and how the LAMP playbooks are executed from within the new Azure infrastructure.

https://bcc.bz/post/azure-devops-ci-ansible-lamp-deployment

There is also a video that shows the execution of the entire process and deploying an update by re-triggering the pipeline.

https://youtu.be/Vlt3Zgk8jKQ

😃