Files
Vincent Bernat d191613ab8 Initial release
No history. If you have the original history, you can use:

```
git replace THISCOMMIT b0b998bd1c651e308ac71a9158e07e5c3521a281
```
2021-05-15 16:18:03 +02:00

21 lines
609 B
Django/Jinja

enable secret {{ lookup('system', 'passwords').root }}
!
{% for user, value in lookup("system", "users").items() %}
{% filter replace("\n", " ") %}
username {{ user }} privilege 15
{% if value["ios-password"] is defined %}
secret {{ value["ios-password"] }}
{% endif %}
{% endfilter %}
{% endfor %}
!
ip ssh version 2
ip ssh pubkey-chain
{% for user, value in lookup("system", "users").items() if value.ssh is defined and value.ssh.startswith("ssh-rsa ") %}
username {{ user }}
key-hash ssh-rsa {{ value.ssh.split()[1] | b64decode | hash('md5') | upper }} {{ user }}
{% endfor %}
ip scp server enable
!