template up the users
This commit is contained in:
parent
e6b58a06f8
commit
64d2556102
20
vyos.conf.j2
20
vyos.conf.j2
@ -1014,13 +1014,27 @@ system {
|
|||||||
}
|
}
|
||||||
|
|
||||||
login {
|
login {
|
||||||
user vyos {
|
{% for user, user_data in pillar['users'].items() %}
|
||||||
|
user {{ user }} {
|
||||||
|
{% if 'authentication' in user_data %}
|
||||||
authentication {
|
authentication {
|
||||||
encrypted-password $6$fXZ3cwEft1XFJTH$twZmVheX0PEi21KqQfv/zvKhuXVc1UwVVXI3Y7KCXYk0osil3QmJqmAYgNQyNqGUROydxp7R6yiPe4N06QnBH1
|
{% if 'encrypted-password' in user_data['authentication'] %}
|
||||||
|
encrypted-password {{ user_data['authentication']['encrypted-password'] }}
|
||||||
plaintext-password ""
|
plaintext-password ""
|
||||||
|
{% else %}
|
||||||
|
plaintext-password '{{ user_data['authentication']['plaintext-password'] }}'
|
||||||
|
{% endif %}
|
||||||
|
{% for key, key_data in user_data['authentication'].get('public-keys',{}).items() %}
|
||||||
|
public-keys {{ key }} {
|
||||||
|
key {{ key_data['key'] }}
|
||||||
|
type {{ key_data.get('type','ssh-rsa') }}
|
||||||
|
}
|
||||||
|
{% endfor %}
|
||||||
}
|
}
|
||||||
level admin
|
{% endif %}
|
||||||
|
level {{ user_data.get('level','operator') }}
|
||||||
}
|
}
|
||||||
|
{% endfor %}
|
||||||
}
|
}
|
||||||
|
|
||||||
{% for nameserver in pillar['nameservers'] %}
|
{% for nameserver in pillar['nameservers'] %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user