-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.59 KB
/
configure-cluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Configure AKS cluster
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'roles/**'
- 'playbook.yml'
- '!**/*.md'
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
configure:
concurrency:
group: kubeconfig
cancel-in-progress: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Ansible
run: |
pipx uninstall ansible-core
pip3 install ansible
ansible-galaxy collection install azure.azcollection community.kubernetes community.general kubernetes.core --force
- name: Install Dependecies
run: |
pip3 install -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements.txt
pip3 install -r ~/.ansible/collections/ansible_collections/community/kubernetes/requirements.txt
- name: Configure Azure Credentials
uses: azure/login@v2
with:
client-id: ${{ secrets.AZ_CLIENT_ID }}
subscription-id: ${{ secrets.AZ_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZ_TENANT_ID }}
- name: Setup kubectl
uses: azure/setup-kubectl@v3
- name: Setup kubelogin
uses: azure/use-kubelogin@v1
with:
kubelogin-version: 'v0.1.4'
- name: Set Cluster Context
uses: azure/aks-set-context@v3
with:
resource-group: wp06cluster-rg
cluster-name: wp06cluster
admin: true
- name: Execute Ansible Playbooks
run: |
ansible-playbook -v playbook.yml