-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move kube config reconfiguration into aks-addons
- Loading branch information
1 parent
5a0af76
commit a15af4c
Showing
2 changed files
with
35 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,35 @@ | ||
--- | ||
- block: | ||
- name: "Create service principal" | ||
command: "az ad sp create-for-rbac \ | ||
-n {{aks_name}} \ | ||
--skip-assignment \ | ||
--years 100" | ||
delegate_to: localhost | ||
ignore_errors: "{{ ansible_check_mode }}" | ||
register: out | ||
|
||
- set_fact: | ||
json: "{{(out.stdout|from_json)}}" | ||
- name: "Create service principal" | ||
command: "az ad sp create-for-rbac \ | ||
-n {{aks_name}} \ | ||
--skip-assignment \ | ||
--years 100" | ||
delegate_to: localhost | ||
ignore_errors: "{{ ansible_check_mode }}" | ||
register: out | ||
|
||
- name: "Create {{aks_resource_group_name}}" | ||
command: "az group create \ | ||
--name {{aks_resource_group_name}} \ | ||
--location {{ az_region }}" | ||
delegate_to: localhost | ||
ignore_errors: "{{ ansible_check_mode }}" | ||
- set_fact: | ||
json: "{{(out.stdout|from_json)}}" | ||
|
||
- name: "Create {{aks_name}}" | ||
command: "az aks create \ | ||
--resource-group {{aks_resource_group_name}} \ | ||
--name {{aks_name}} \ | ||
--node-count {{node_count}} \ | ||
--node-vm-size {{node_vm_size}} \ | ||
--kubernetes-version {{kubernetes_version}} \ | ||
--generate-ssh-keys \ | ||
--service-principal {{item.appId}} \ | ||
--client-secret {{item.password}} \ | ||
--no-wait" | ||
delegate_to: localhost | ||
ignore_errors: "{{ ansible_check_mode }}" | ||
with_items: | ||
- { appId: "{{json.appId}}", password: "{{json.password}}" } | ||
- name: "Create {{aks_resource_group_name}}" | ||
command: "az group create \ | ||
--name {{aks_resource_group_name}} \ | ||
--location {{ az_region }}" | ||
delegate_to: localhost | ||
ignore_errors: "{{ ansible_check_mode }}" | ||
|
||
- name: "Configure kubectl to use {{aks_name}}" | ||
command: "az aks get-credentials \ | ||
- name: "Create {{aks_name}}" | ||
command: "az aks create \ | ||
--resource-group {{aks_resource_group_name}} \ | ||
--name {{aks_name}}" | ||
--name {{aks_name}} \ | ||
--node-count {{node_count}} \ | ||
--node-vm-size {{node_vm_size}} \ | ||
--kubernetes-version {{kubernetes_version}} \ | ||
--generate-ssh-keys \ | ||
--service-principal {{item.appId}} \ | ||
--client-secret {{item.password}} \ | ||
--no-wait" | ||
delegate_to: localhost | ||
ignore_errors: "{{ ansible_check_mode }}" | ||
with_items: | ||
- { appId: "{{json.appId}}", password: "{{json.password}}" } |