openshift-container-platfor.../setup-azure-master-origin.yaml

69 строки
1.9 KiB
YAML
Исходник Обычный вид История

2018-04-27 08:51:25 +03:00
---
- hosts: masters
gather_facts: no
serial: 1
become: yes
vars:
azure_conf_dir: /etc/azure
azure_conf: "{{ azure_conf_dir }}/azure.conf"
master_conf: /etc/origin/master/master-config.yaml
handlers:
- name: restart origin-master-api
systemd:
state: restarted
name: origin-master-api
- name: restart origin-master-controllers
systemd:
state: restarted
name: origin-master-controllers
post_tasks:
- name: make sure /etc/azure exists
file:
state: directory
path: "{{ azure_conf_dir }}"
- name: populate /etc/azure/azure.conf
copy:
dest: "{{ azure_conf }}"
content: |
{
"aadClientId": "{{ lookup('env','AADCLIENTID') }}",
"aadClientSecret": "{{ lookup('env','AADCLIENTSECRET') }}",
"aadTenantId": "{{ lookup('env','TENANTID') }}",
"subscriptionId": "{{ lookup('env','SUBSCRIPTIONID') }}",
"tenantId": "{{ lookup('env','TENANTID') }}",
"resourceGroup": "{{ lookup('env','RESOURCEGROUP') }}",
"location": "{{ lookup('env','LOCATION') }}",
"cloud": "{{ lookup('env','CLOUDNAME')}}"
}
notify:
- restart origin-master-api
- restart origin-master-controllers
- name: insert the azure disk config into the master
modify_yaml:
dest: "{{ master_conf }}"
yaml_key: "{{ item.key }}"
yaml_value: "{{ item.value }}"
with_items:
- key: kubernetesMasterConfig.apiServerArguments.cloud-config
value:
- "{{ azure_conf }}"
- key: kubernetesMasterConfig.apiServerArguments.cloud-provider
value:
- azure
- key: kubernetesMasterConfig.controllerArguments.cloud-config
value:
- "{{ azure_conf }}"
- key: kubernetesMasterConfig.controllerArguments.cloud-provider
value:
- azure
notify:
- restart origin-master-api
- restart origin-master-controllers