-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reduce duplicated code blocks by templates
- Loading branch information
Showing
7 changed files
with
49 additions
and
228 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
roles/installer/templates/common/volume_mounts/extra_settings_files.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% if extra_settings_files.configmaps is defined and extra_settings_files.configmaps | length %} | ||
{% for configmap in extra_settings_files.configmaps %} | ||
- name: {{ ansible_operator_meta.name }}-{{ configmap.key | replace('_', '-') | replace('.', '-') | lower }}-configmap | ||
mountPath: "/etc/tower/conf.d/{{ configmap.key }}" | ||
subPath: {{ configmap.key }} | ||
readOnly: true | ||
{% endfor %} | ||
{% endif %} | ||
{% if extra_settings_files.secrets is defined and extra_settings_files.secrets | length %} | ||
{% for secret in extra_settings_files.secrets %} | ||
- name: {{ ansible_operator_meta.name }}-{{ secret.key | replace('_', '-') | replace('.', '-') | lower }}-secret | ||
mountPath: "/etc/tower/conf.d/{{ secret.key }}" | ||
subPath: {{ secret.key }} | ||
readOnly: true | ||
{% endfor %} | ||
{% endif %} |
20 changes: 20 additions & 0 deletions
20
roles/installer/templates/common/volumes/extra_settings_files.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% if extra_settings_files.configmaps is defined and extra_settings_files.configmaps | length %} | ||
{% for configmap in extra_settings_files.configmaps %} | ||
- name: {{ ansible_operator_meta.name }}-{{ configmap.key | replace('_', '-') | replace('.', '-') | lower }}-configmap | ||
configMap: | ||
name: {{ configmap.name }} | ||
items: | ||
- key: {{ configmap.key }} | ||
path: {{ configmap.key }} | ||
{% endfor %} | ||
{% endif %} | ||
{% if extra_settings_files.secrets is defined and extra_settings_files.secrets | length %} | ||
{% for secret in extra_settings_files.secrets %} | ||
- name: {{ ansible_operator_meta.name }}-{{ secret.key | replace('_', '-') | replace('.', '-') | lower }}-secret | ||
secret: | ||
secretName: {{ secret.name }} | ||
items: | ||
- key: {{ secret.key }} | ||
path: {{ secret.key }} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters