Files
toallab-automation/roles/ansible-network.cisco_ios/templates/configure_user.j2
Patrick Toal 6e2205a046 Adding Netbox
2019-05-06 00:34:45 -04:00

31 lines
677 B
Django/Jinja

{% for user in users %}
{% if user.state is defined and user.state == 'absent' %}
no username {{ user.name }}
ip ssh pubkey-chain
no username {{ user.name }}
{% else %}
{% if user.password is not defined %}
username {{ user.name }} nopassword
{% elif user.password %}
username {{ user.name }} secret {{ user.password }}
{% endif %}
{% if user.privilege is defined %}
username {{ user.name }} privilege {{ user.privilege|string }}
{% endif %}
{% if user.view is defined %}
username {{ user.name }} view {{ user.view }}
{% endif %}
{% if user.sshkey is defined %}
ip ssh pubkey-chain
username {{ user.name }}
key-hash {{ user.sshkey }}
{% endif %}
{% endif %}
{% endfor %}