openshift-container-platfor.../setup-azure-node.yaml

52 строки
1.5 KiB
YAML

---
- hosts: nodes:!masters
serial: 1
gather_facts: no
become: yes
vars:
azure_conf_dir: /etc/azure
azure_conf: "{{ azure_conf_dir }}/azure.conf"
node_conf: /etc/origin/node/node-config.yaml
handlers:
- name: restart atomic-openshift-node
systemd:
state: restarted
name: atomic-openshift-node
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 atomic-openshift-node
- name: insert the azure disk config into the node
modify_yaml:
dest: "{{ node_conf }}"
yaml_key: "{{ item.key }}"
yaml_value: "{{ item.value }}"
with_items:
- key: kubeletArguments.cloud-config
value:
- "{{ azure_conf }}"
- key: kubeletArguments.cloud-provider
value:
- azure
notify:
- restart atomic-openshift-node