grog / ansible-role-authorized-key Goto Github PK
View Code? Open in Web Editor NEWAnsible role for managing authorized keys.
Home Page: https://galaxy.ansible.com/GROG/authorized-key
License: MIT License
Ansible role for managing authorized keys.
Home Page: https://galaxy.ansible.com/GROG/authorized-key
License: MIT License
ASK [GROG.authorized-key : Manage authorized keys] *********************************************************************************************************************************************************************************************
task path: /private/etc/ansible/roles/GROG.authorized-key/tasks/main.yml:3
fatal: [10.82.136.9]: FAILED! => {
"failed": true,
"msg": "{{ authorized_key_list + authorized_key_list_host + authorized_key_list_group }}: [{u'authorized_keys': [{u'key': u"{{ lookup('file', 'files/user.keys) }}"}], u'name': u'user'}]: template error while templating string: unexpected char u"'" at 18. String: {{ lookup('file', 'files/user.keys) }}"
}
fatal: [10.104.136.14]: FAILED! => {
"failed": true,
"msg": "{{ authorized_key_list + authorized_key_list_host + authorized_key_list_group }}: [{u'authorized_keys': [{u'key': u"{{ lookup('file', 'files/user.keys) }}"}], u'name': u'user'}]: template error while templating string: unexpected char u"'" at 18. String: {{ lookup('file', 'files/user.keys) }}"
}
fatal: [10.3.8.5]: FAILED! => {
"failed": true,
"msg": "{{ authorized_key_list + authorized_key_list_host + authorized_key_list_group }}: [{u'authorized_keys': [{u'key': u"{{ lookup('file', 'files/user.keys) }}"}], u'name': u'user'}]: template error while templating string: unexpected char u"'" at 18. String: {{ lookup('file', 'files/user.keys) }}"
}
ssh-keys.yaml:
---
- hosts: azure
roles:
- { role: GROG.authorized-key, become: yes }
servers.yaml
authorized_key_list_group:
- name: egilb1
authorized_keys:
- key: "{{ lookup('file', 'files/egilb1.keys) }}"
files/user.keys is in the dir I'm running the playbook from, so the path is relative.
exclusive option is not working as exepected for me
maybe linked to this :
http://docs.ansible.com/ansible/authorized_key_module.html
say :
This option is not loop aware, so if you use with_ , it will be exclusive per iteration of the loop, if you want multiple keys in the file you need to pass them all to key in a single batch as mentioned above.
i want to manage root ssh key (only used for emergency issue) for several user but i want/need to be sure, no other person can connect as root with ssh keys
I have create :
authorized_key_list:
so if
On a fresh opensuse 15.1 installation i get an AttributeError.
Another opensuse 15.1 installation works flawlessly.
Any clue what kind of dependency is missing?
The full traceback is:
Traceback (most recent call last):
File "", line 114, in
File "", line 106, in _ansiballz_main
File "", line 49, in invoke_module
File "/tmp/ansible_authorized_key_payload_4oX_0b/main.py", line 230, in
File "/tmp/ansible_authorized_key_payload_4oX_0b/ansible_authorized_key_payload.zip/ansible/module_utils/urls.py", line 402, in
AttributeError: 'module' object has no attribute 'HTTPSConnection'
failed: [test] (item=[{'name': 'acb'}, {'key': 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFS3XxUR92/mvUnjDgYBW7tUl0sp6uT28WG9CzIIPQXP 20190710 - harkonnen - kallisti'}]) => {
"ansible_loop_var": "item",
"changed": false,
"item": [
{
"name": "acb"
},
{
"key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFS3XxUR92/mvUnjDgYBW7tUl0sp6uT28WG9CzIIPQXP 20190710 - harkonnen - kallisti"
}
],
"module_stderr": "Traceback (most recent call last):\n File "", line 114, in \n File "", line 106, in _ansiballz_main\n File "", line 49, in invoke_module\n File "/tmp/ansible_authorized_key_payload_4oX_0b/main.py", line 230, in \n File "/tmp/ansible_authorized_key_payload_4oX_0b/ansible_authorized_key_payload.zip/ansible/module_utils/urls.py", line 402, in \nAttributeError: 'module' object has no attribute 'HTTPSConnection'\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.