Commit ff12969d by Karsa Zoltán István

jinja help

parent 98a0d2ee
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ul> <ul>
<li>{% trans "<code>hostname</code> - vm hostname" %}</li> <li>{% trans "<code>hostname</code> - vm hostname" %}</li>
<li>{% trans "<code>sysuser</code> - vm system default user (cloud)" %}</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>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.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> <li>{% trans "<code>acl.operators</code> - get all associated operator level user's username to vm (list)" %}</li>
...@@ -22,6 +22,7 @@ ...@@ -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>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> <li>{% trans "<code>ci.rndstr(len: int)</code> - function: make random string with 'len' charachters lenght" %}</li>
</ul> </ul>
<p>{% tran "Filters: hash - sha512 hash method" %}</p>
<b>Example:</b> <b>Example:</b>
<pre>{% verbatim %} <pre>{% verbatim %}
#cloud-config #cloud-config
...@@ -34,18 +35,12 @@ users: ...@@ -34,18 +35,12 @@ users:
ssh_pwauth: True ssh_pwauth: True
chpasswd: { expire: False } chpasswd: { expire: False }
lock-passwd: false lock-passwd: false
passwd: "{{password}}" passwd: "{{ password | hash }}"
ssh_authorized_keys: ssh_authorized_keys:
- {{ ssh.keys['my-key'] }} - {{ ssh.keys['my-key'] }}
{% for u in acl.operators %} {% for u in acl.operators %}
- name: {{i}} - name: {{i}}
- shell: /bin/bash shell: /bin/bash
{% endfor %}
chpasswd:
expire: False
list: |
{% for u in acl.operators %}
{{u}} : {{ci.rndstr(10)}}
{% endfor %} {% endfor %}
{% endverbatim %}</pre> {% endverbatim %}</pre>
</div> </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