summaryrefslogtreecommitdiffstats
path: root/ansible/roles/k8s-persistent-volume/tasks/main.yml
blob: 02fbbb26d0ff15c69ff87caf2001477930c02bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
- name: Install OpenShift Python client library  # community.kubernetes.k8s module dependency
  package:
    name: 'python2-openshift'
    state: present
  when: ansible_os_family == 'RedHat'

- name: Create k8s persistent volumes
  community.kubernetes.k8s:
    wait: True
    template: pv.yaml.j2
  loop: "{{ k8s_volumes }}"

- name: Create host paths for PVs and set their permissions
  file:
    path: "{{ item.path_prefix }}/{{ item.name }}"
    state: directory
    owner: "{{ item.owner | default(0) }}"
    group: "{{ item.group | default(0) }}"
  loop: "{{ k8s_volumes }}"