robertdebock / ansible-role-users

The purpose of this role is to add users and groups on your system.
https://robertdebock.nl/
Apache License 2.0
42 stars 27 forks source link

authorized_key(s) issue #4

Closed tlc closed 5 years ago

tlc commented 5 years ago

Describe the bug Perhaps I don't understand the intent but, 1) Setting authorized_key without setting authorized_keys has no effect:
"skip_reason": "Conditional result was False" 2) Setting authorized_keys without setting authorized_key causes an error: "'dict object' has no attribute 'authorized_key'" 3) Using both together work.

To Reproduce Playbook fragment:

users_user_list:
  - name: fred
    uid: 1003
    group: fred
    groups: 'adm,sudo'
    authorized_key: "{{ lookup('file', '/home/fred/.ssh/id_rsa.pub') }}"
    authorized_keys:
      - "{{ lookup('file', '/home/fred/.ssh/id_rsa.pub') }}"
    shell: /bin/bash
robertdebock commented 5 years ago

Hm, you could be right, I'll try to reproduce and think of a fix.

Thanks!