Skip to content

Commit 5b5c181

Browse files
committed
add volume config generation
1 parent 48518bb commit 5b5c181

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

roles/openshift_node_group/tasks/create_config.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@
4444
when: openshift_node_group_edits|length > 0
4545
run_once: true
4646

47+
- name: create volume config template
48+
template:
49+
src: volume-config.yaml.j2
50+
dest: "{{ mktempout.stdout }}/volume-config.yaml"
51+
when:
52+
- configout.results.results.0 == {} and openshift_node_group_name != "" and openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != ""
53+
run_once: true
54+
55+
- name: lay down the volume config from the existing configmap
56+
copy:
57+
content: "{{ configout.results.results.0.data['volume-config.yaml'] }}"
58+
dest: "{{ mktempout.stdout }}/volume-config.yaml"
59+
when:
60+
- configout.results.results.0 != {} and openshift_node_group_name != "" and openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != ""
61+
run_once: true
62+
4763
- debug: var=yeditout
4864
run_once: true
4965

@@ -53,6 +69,19 @@
5369
namespace: "{{ openshift_node_group_namespace }}"
5470
from_file:
5571
node-config.yaml: "{{ mktempout.stdout }}/node-config.yaml"
72+
when:
73+
- openshift_node_local_quota_per_fsgroup is undefined or openshift_node_local_quota_per_fsgroup == ""
74+
run_once: true
75+
76+
- name: create node-config.yaml and volume-config.yaml configmap
77+
oc_configmap:
78+
name: "{{ openshift_node_group_name }}"
79+
namespace: "{{ openshift_node_group_namespace }}"
80+
from_file:
81+
node-config.yaml: "{{ mktempout.stdout }}/node-config.yaml"
82+
volume-config.yaml: "{{ mktempout.stdout }}/volume-config.yaml"
83+
when:
84+
- openshift_node_local_quota_per_fsgroup is defined and openshift_node_local_quota_per_fsgroup != ""
5685
run_once: true
5786

5887
- name: remove templated files
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kubelet.config.openshift.io/v1
2+
kind: VolumeConfig
3+
localQuota:
4+
perFSGroup: {{ openshift_node_local_quota_per_fsgroup }}

0 commit comments

Comments
 (0)