Commit ff12969d by Karsa Zoltán István

jinja help

parent 98a0d2ee
......@@ -11,7 +11,7 @@
<ul>
<li>{% trans "<code>hostname</code> - vm hostname" %}</li>
<li>{% trans "<code>sysuser</code> - vm system default user (cloud)" %}</li>
<li>{% trans "<code>password</code> - default user sha512 password" %}</li>
<li>{% trans "<code>password</code> - default user password (use 'hash' filter to convert sha512)" %}</li>
<li>{% trans "<code>owner</code> - vm owner django username" %}</li>
<li>{% trans "<code>acl.allusers</code> - get all associated user's username to vm (list)" %}</li>
<li>{% trans "<code>acl.operators</code> - get all associated operator level user's username to vm (list)" %}</li>
......@@ -22,6 +22,7 @@
<li>{% trans "<code>ssh.keys</code> - owner's ssh-keys dictionary: the key is the ssh-key's name" %}</li>
<li>{% trans "<code>ci.rndstr(len: int)</code> - function: make random string with 'len' charachters lenght" %}</li>
</ul>
<p>{% tran "Filters: hash - sha512 hash method" %}</p>
<b>Example:</b>
<pre>{% verbatim %}
#cloud-config
......@@ -34,18 +35,12 @@ users:
ssh_pwauth: True
chpasswd: { expire: False }
lock-passwd: false
passwd: "{{password}}"
passwd: "{{ password | hash }}"
ssh_authorized_keys:
- {{ ssh.keys['my-key'] }}
{% for u in acl.operators %}
- name: {{i}}
- shell: /bin/bash
{% endfor %}
chpasswd:
expire: False
list: |
{% for u in acl.operators %}
{{u}} : {{ci.rndstr(10)}}
shell: /bin/bash
{% endfor %}
{% endverbatim %}</pre>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment