2019-02-26 14:45:30 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Local Path Provisioner | Create addon dir
|
|
|
|
file:
|
|
|
|
path: "{{ kube_config_dir }}/addons/local_path_provisioner"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
when:
|
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
|
|
|
|
|
|
|
- name: Local Path Provisioner | Create claim root dir
|
|
|
|
file:
|
|
|
|
path: "{{ local_path_provisioner_claim_root }}"
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Local Path Provisioner | Render Template
|
|
|
|
set_fact:
|
|
|
|
local_path_provisioner_templates:
|
|
|
|
- { name: local-path-storage, file: local-path-storage.yaml, type: sc }
|
|
|
|
|
|
|
|
- name: Local Path Provisioner | Create manifests
|
|
|
|
template:
|
|
|
|
src: "{{ item.file }}.j2"
|
|
|
|
dest: "{{ kube_config_dir }}/addons/local_path_provisioner/{{ item.file }}"
|
|
|
|
with_items: "{{ local_path_provisioner_templates }}"
|
|
|
|
register: local_path_provisioner_manifests
|
|
|
|
when: inventory_hostname == groups['kube-master'][0]
|
|
|
|
|
|
|
|
- name: Local Path Provisioner | Apply manifests
|
|
|
|
kube:
|
2019-04-24 01:37:23 +08:00
|
|
|
name: "{{ item.item.name }}"
|
2019-02-26 14:45:30 +08:00
|
|
|
namespace: "{{ local_path_provisioner_namespace }}"
|
|
|
|
kubectl: "{{ bin_dir }}/kubectl"
|
2019-04-24 01:37:23 +08:00
|
|
|
resource: "{{ item.item.type }}"
|
|
|
|
filename: "{{ kube_config_dir }}/addons/local_path_provisioner/{{ item.item.file }}"
|
2019-02-26 14:45:30 +08:00
|
|
|
state: "latest"
|
2019-04-24 01:37:23 +08:00
|
|
|
with_items: "{{ local_path_provisioner_manifests.results }}"
|
2019-02-26 14:45:30 +08:00
|
|
|
when: inventory_hostname == groups['kube-master'][0]
|