Browse Source

more dynamic configuration

pull/3/head
Lilian Roller 1 year ago
parent
commit
29ec544969
No account linked to committer's email address
3 changed files with 4 additions and 1 deletions
  1. +1
    -0
      README.md
  2. +2
    -0
      defaults/main.yml
  3. +1
    -1
      templates/authorized_keys.j2

+ 1
- 0
README.md View File

@@ -21,6 +21,7 @@ Ansible Rolle to setup users and deploy your ssh keys
* ``ssh_public_key_store`` (default ``ssh_public_keys``):<br/>
A directory path where the public key files can be found by ansible.

For aditional variables please have a look into ``defaults/main.yml``!

Files
-----

+ 2
- 0
defaults/main.yml View File

@@ -12,3 +12,5 @@ users: {}
# all users who should be available on this host
accounts: []

# SSH Login Warning
ssh_root_login_warning: 'Please login as your own user rather than the user \"root\".'

+ 1
- 1
templates/authorized_keys.j2 View File

@@ -3,7 +3,7 @@
{% for user_name in remote_users|sort %}
# {{ user_name }}
{% for keyfile in lookup('fileglob', '{}/{}_*.pub'.format(ssh_public_key_store, user_name), wantlist=True) %}
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as your own user rather than the user \"root\".';echo;sleep 10" {{ lookup('file', keyfile) }}
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo '{{ ssh_root_login_warning }}';echo;sleep 10" {{ lookup('file', keyfile) }}
{% endfor %}
{% endfor %}


Loading…
Cancel
Save