notify:, runs once at endsetup module--- - name: Deploy web app hosts: webservers become: true vars: app_port: 8080 tasks: - name: Install nginx ansible.builtin.apt: name: nginx state: present notify: restart nginx handlers: - name: restart nginx ansible.builtin.service: name: nginx state: restarted
roles/myrole/ ├── tasks/main.yml ├── handlers/main.yml ├── templates/app.conf.j2 ├── files/ ├── vars/main.yml ├── defaults/main.yml └── meta/main.yml
{
"mode": "Indexed",
"policyRule": {
"if": {
"allOf": [
{ "field": "type",
"equals": "Microsoft.Storage/storageAccounts" },
{ "field": "tags['env']",
"exists": "false" }
]
},
"then": {
"effect": "deny"
}
}
}
azure-arc namespace# Generate install script in portal or via CLI az connectedmachine generate-install-script \ --resource-group myRG \ --location eastus \ --os linux # Run generated script on the target machine sudo bash install_linux_azcmagent.sh \ --resource-group "myRG" \ --tenant-id "<tid>" \ --subscription-id "<sid>" \ --location "eastus"
# Prerequisites: kubectl + az CLI az extension add --name connectedk8s az connectedk8s connect \ --name myCluster \ --resource-group myRG \ --location eastus # Verify agent pods in azure-arc namespace kubectl get pods -n azure-arc
az k8s-configuration flux create \ --name my-app-config \ --cluster-name myCluster \ --cluster-type connectedClusters \ --resource-group myRG \ --url https://github.com/org/repo \ --branch main \ --kustomization name=apps path=./clusters/prod