templating

Helm - Templating variables in values.yaml

泄露秘密 提交于 2021-02-07 13:01:22
问题 I'm trying to template variables from a map inside the values.yaml into my final Kubernetes ConfigMap YAML. I've read through https://github.com/helm/helm/issues/2492 and https://helm.sh/docs/chart_template_guide/ but can't seem to find an answer. For some context, this is roughly what I'm trying to do: values.yaml config: key1: value key2: value-{{ .Release.Name }} configmap.yaml kind: ConfigMap data: config-file: | {{- range $key, $value := .Values.config }} {{ $key }} = {{ $value }} {{-

Helm - Templating variables in values.yaml

给你一囗甜甜゛ 提交于 2021-02-07 13:01:11
问题 I'm trying to template variables from a map inside the values.yaml into my final Kubernetes ConfigMap YAML. I've read through https://github.com/helm/helm/issues/2492 and https://helm.sh/docs/chart_template_guide/ but can't seem to find an answer. For some context, this is roughly what I'm trying to do: values.yaml config: key1: value key2: value-{{ .Release.Name }} configmap.yaml kind: ConfigMap data: config-file: | {{- range $key, $value := .Values.config }} {{ $key }} = {{ $value }} {{-

AnsibleError: template error while templating string: expected token ':', got '}'

北慕城南 提交于 2021-01-27 22:03:32
问题 An error occurs when preparing the template. Who can tell you how to fix it? Variables, if necessary, can also be edited. vars: AllСountry: - "name1" - "name2" name1: - "region1a" - "region1b" name2: - "region2a" - "region2b" Code {% for country in AllСountry %} {name: "{{ country }}",{% for count in {{ country }} %}My country = {{ count }} {% endfor %}{% endfor %} the result is an error AnsibleError: template error while templating string: expected token ':', got '}' Yes in the end I expect

Ansible: Unexpected templating type error: expected string or buffer

為{幸葍}努か 提交于 2020-08-07 05:25:40
问题 I have a register with the following contents: ok: [hostname] => { "changed": false, "msg": { "changed": true, "cmd": "cd /tmp\n ./status.sh dev", "delta": "0:00:00.023660", "end": "2018-11-28 17:46:05.838934", "rc": 0, "start": "2018-11-28 17:46:05.815274", "stderr": "", "stderr_lines": [], "stdout": "application is not running. no pid file found", "stdout_lines": [ "application is not running. no pid file found" ] } } When i see the substring "not" in the register's stdout, i want to

How to create a master page?

强颜欢笑 提交于 2020-07-03 03:49:27
问题 I need to create a master page in JSP to be used by other JSPs for them to have the same look and feel and menus. How can I do that in JSP? 回答1: You can use either <%@ include file="/absoluteFragment.jsp" %> or <jsp:include page="relativeDynFragment.jsp" /> To know the difference see also http://www.jguru.com/faq/view.jsp?EID=13517: The <%@include file="abc.jsp"%> directive acts like C "#include" , pulling in the text of the included file and compiling it as if it were part of the including

Can I render multiple sources in EJS

我只是一个虾纸丫 提交于 2020-01-13 19:41:07
问题 I am attempting to use data from 2 different sources, but render them on the same HTML page using EJS, JS and node. This is what I am trying.. app.set('view engine', 'ejs'); app.get('/', function(req, res) { res.render('index.ejs', { data: JSONdata }) res.render('index.ejs', {data2: arrayData}) }); data is a JSON, data2 is an array. I have attempted to look up proper syntax for this exact process but cant seem to find anything. Many thanks. 回答1: You cannot render more than once to a single

Apply a class to every nth template element with knockoutjs

强颜欢笑 提交于 2020-01-03 06:31:12
问题 I've been experimenting with knockoutjs, reworking an existing project. My current layout has the logic to determine if the rendered <div> tag is the first or fourth item. if (index % 4 == 0) addClass('omega'); if (index % 4 == 1) addClass('alpha'); Is there any built-in functionality of knockout that can template similar conditions? 回答1: A few options for you: there is work being done to add a $index variable when doing a foreach in KO. This is scheduled to be included in KO 2.1. The pull