2018-09-06 14:26:57 +00:00
|
|
|
---
|
2018-08-23 14:51:52 +00:00
|
|
|
- name: Create kubernetes directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: kube
|
|
|
|
when: inventory_hostname in groups['k8s-cluster']
|
|
|
|
become: true
|
|
|
|
tags:
|
|
|
|
- kubelet
|
|
|
|
- k8s-secrets
|
|
|
|
- kube-controller-manager
|
|
|
|
- kube-apiserver
|
|
|
|
- bootstrap-os
|
|
|
|
- apps
|
|
|
|
- network
|
|
|
|
- master
|
|
|
|
- node
|
|
|
|
with_items:
|
|
|
|
- "{{bin_dir}}"
|
|
|
|
- "{{ kube_config_dir }}"
|
2018-12-07 07:11:53 +00:00
|
|
|
- "{{ kube_cert_dir }}"
|
2018-08-23 14:51:52 +00:00
|
|
|
- "{{ kube_manifest_dir }}"
|
|
|
|
- "{{ kube_script_dir }}"
|
|
|
|
|
|
|
|
- name: Create cni directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: kube
|
|
|
|
with_items:
|
|
|
|
- "/etc/cni/net.d"
|
|
|
|
- "/opt/cni/bin"
|
|
|
|
- "/var/lib/calico"
|
|
|
|
when:
|
2018-10-16 14:15:05 +00:00
|
|
|
- kube_network_plugin in ["calico", "weave", "canal", "flannel", "contiv", "cilium", "kube-router"]
|
2018-08-23 14:51:52 +00:00
|
|
|
- inventory_hostname in groups['k8s-cluster']
|
|
|
|
tags:
|
|
|
|
- network
|
|
|
|
- cilium
|
|
|
|
- calico
|
|
|
|
- weave
|
|
|
|
- canal
|
|
|
|
- contiv
|
2018-10-16 14:15:05 +00:00
|
|
|
- kube-router
|
2018-08-23 14:51:52 +00:00
|
|
|
- bootstrap-os
|
|
|
|
|
|
|
|
- name: Create local volume provisioner directories
|
|
|
|
file:
|
2019-01-08 23:32:39 +00:00
|
|
|
path: "{{ local_volume_provisioner_storage_classes[item].host_dir }}"
|
2018-08-23 14:51:52 +00:00
|
|
|
state: directory
|
2018-10-05 12:52:25 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0700
|
2019-01-08 23:32:39 +00:00
|
|
|
with_items: "{{ local_volume_provisioner_storage_classes.keys() }}"
|
2018-08-23 14:51:52 +00:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups['k8s-cluster']
|
|
|
|
- local_volume_provisioner_enabled
|
|
|
|
tags:
|
|
|
|
- persistent_volumes
|