From 7d241e7a6c26248301526ca627e562af2825422a Mon Sep 17 00:00:00 2001 From: portdirect Date: Fri, 30 Mar 2018 00:52:03 -0400 Subject: [PATCH] Ironic: Move all config to be directly values driven. This PS moves all the config files to be directly values driven, both simplifying over-ride and allowing configs to be targeted to pods in future work. Change-Id: I177ddfe8c932733aeacb0fdb9b3e60ef75881c6a --- ironic/templates/configmap-etc.yaml | 22 ++----------- ironic/templates/etc/_nginx.conf.tpl | 41 ------------------------- ironic/templates/etc/_tftp-map-file.tpl | 4 --- ironic/values.yaml | 40 ++++++++++++++++++++---- 4 files changed, 37 insertions(+), 70 deletions(-) delete mode 100644 ironic/templates/etc/_nginx.conf.tpl delete mode 100644 ironic/templates/etc/_tftp-map-file.tpl diff --git a/ironic/templates/configmap-etc.yaml b/ironic/templates/configmap-etc.yaml index 276289d9b6..73bd0def3e 100644 --- a/ironic/templates/configmap-etc.yaml +++ b/ironic/templates/configmap-etc.yaml @@ -194,22 +194,6 @@ data: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.ironic | indent 4 }} policy.json: | {{ toJson .Values.conf.policy | indent 4 }} - tftp-map-file: | -{{ if .Values.conf.tftp_map_file.override -}} -{{ .Values.conf.tftp_map_file.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_tftp-map-file.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.tftp_map_file.append -}} -{{ .Values.conf.tftp_map_file.append | indent 4 }} -{{- end }} - nginx.conf: | -{{ if .Values.conf.nginx.override -}} -{{ .Values.conf.nginx.override | indent 4 }} -{{- else -}} -{{ tuple "etc/_nginx.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} -{{- if .Values.conf.nginx.append -}} -{{ .Values.conf.nginx.append | indent 4 }} -{{- end }} -{{- end }} +{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.tftp_map_file "key" "tftp-map-file") | indent 2 }} +{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.nginx "key" "nginx.conf") | indent 2 }} +{{- end }} \ No newline at end of file diff --git a/ironic/templates/etc/_nginx.conf.tpl b/ironic/templates/etc/_nginx.conf.tpl deleted file mode 100644 index e070746b3c..0000000000 --- a/ironic/templates/etc/_nginx.conf.tpl +++ /dev/null @@ -1,41 +0,0 @@ -user nginx; -worker_processes 1; - -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; - - -events { - worker_connections 1024; -} - - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - - sendfile on; - #tcp_nopush on; - - keepalive_timeout 65; - - #gzip on; - - server { - listen OSH_PXE_IP:{{ tuple "baremetal" "internal" "pxe_http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}; - server_name localhost; - - #charset koi8-r; - #access_log /var/log/nginx/host.access.log main; - - location / { - root /var/lib/openstack-helm/httpboot; - } - } -} diff --git a/ironic/templates/etc/_tftp-map-file.tpl b/ironic/templates/etc/_tftp-map-file.tpl deleted file mode 100644 index 812abe0c5c..0000000000 --- a/ironic/templates/etc/_tftp-map-file.tpl +++ /dev/null @@ -1,4 +0,0 @@ -re ^(/tftpboot/) /tftpboot/\2 -re ^/tftpboot/ /tftpboot/ -re ^(^/) /tftpboot/\1 -re ^([^/]) /tftpboot/\1 diff --git a/ironic/values.yaml b/ironic/values.yaml index 5dc746db7e..9c9a966758 100644 --- a/ironic/values.yaml +++ b/ironic/values.yaml @@ -53,12 +53,40 @@ conf: override: append: policy: {} - tftp_map_file: - override: - append: - nginx: - override: - append: + tftp_map_file: | + re ^(/tftpboot/) /tftpboot/\2 + re ^/tftpboot/ /tftpboot/ + re ^(^/) /tftpboot/\1 + re ^([^/]) /tftpboot/\1 + nginx: | + user nginx; + worker_processes 1; + error_log /var/log/nginx/error.log warn; + pid /var/run/nginx.pid; + events { + worker_connections 1024; + } + http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log /var/log/nginx/access.log main; + sendfile on; + #tcp_nopush on; + keepalive_timeout 65; + #gzip on; + server { + listen OSH_PXE_IP:{{ tuple "baremetal" "internal" "pxe_http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}; + server_name localhost; + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + location / { + root /var/lib/openstack-helm/httpboot; + } + } + } ironic: DEFAULT: enabled_drivers: agent_ipmitool