The objective of the repo is to record my learning progress in automation on Azure with Terraform and Ansible. Project 2 is a more integrated and complete project. Feel free to play around with it~
terraform init
terraform validate
terraform plan
terraform apply
terraform outputs
terraform destroy
terraform state list
terraform show
Configure Azure blob container to store Terraform state information for security and team collaboration. First, define backend.tf. Then, follow the standard way to apply all .tf.
az group create -l canadacentral -n tfstate<ID>RG
az storage account create -l canadacentral -n tfstate<ID>sa -g tfstate<ID>RG --sku Standard_LRS
az storage account keys list -g tfstate<ID>RG -n tfstate<ID>sa
az storage container create -n tfstatefiles --account-name tfstate<ID>sa --account-key “<access-key-from-previous-step>”
export ARM_ACCESS_KEY=<access-key-from-previous-step>
terraform fmt -recursive
az vm image list >> images
az vm image list --offer CentOS --all
brew install ansible
ansible --version
source /usr/local/Cellar/ansible/7.3.0/libexec/bin/activate
pip install <<packages>>
ansible-inventory --graph
ansible --list-hosts <<group>>
ansible <host> -m <module> -a <arguments>
ansible-playbook -C playbook.yml
ansible-playbook playbook.yml --syntax-check
ansible-playbook playbook.yml
ansible-playbook --list-tasks playbook.yml
ansible-playbook --list-hosts playbook.yml
ansible-doc module_name
winrm set winrm/config/service '@{AllowUnencrypted="true"}'