Browse Source

more dynamic configuration

Lilian Roller 2 months 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
21 21
 * ``ssh_public_key_store`` (default ``ssh_public_keys``):<br/>
22 22
   A directory path where the public key files can be found by ansible.
23 23
 
24
+For aditional variables please have a look into ``defaults/main.yml``!
24 25
 
25 26
  Files
26 27
 -----

+ 2
- 0
defaults/main.yml View File

@@ -12,3 +12,5 @@ users: {}
12 12
 # all users who should be available on this host
13 13
 accounts: []
14 14
 
15
+# SSH Login Warning
16
+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 @@
3 3
 {% for user_name in remote_users|sort %}
4 4
 # {{ user_name }}
5 5
 {% for keyfile in lookup('fileglob', '{}/{}_*.pub'.format(ssh_public_key_store, user_name), wantlist=True) %}
6
-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) }}
6
+no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo '{{ ssh_root_login_warning }}';echo;sleep 10" {{ lookup('file', keyfile) }}
7 7
 {% endfor %}
8 8
 {% endfor %}
9 9