Commit graph

11 commits

Author SHA1 Message Date
Sam Thursfield
60397fae0f Fix authorized_key module crashing when given an invalid key
I tried a playbook with the following (accidentally wrong) task:

  tasks:
      - name: authorized key test
        authorized_key: key=/home/sam/.ssh/id_rsa.pub key_options='command="/foo/bar"' user=sam

I got the following traceback:

    TASK: [authorized key test] ***************************************************
    failed: [localhost] => {"failed": true, "parsed": false}
    Traceback (most recent call last):
    File "/home/sam/.ansible/tmp/ansible-tmp-1427110003.65-277897441194582/authorized_key", line 2515, in <module>
        main()
    File "/home/sam/.ansible/tmp/ansible-tmp-1427110003.65-277897441194582/authorized_key", line 460, in main
        results = enforce_state(module, module.params)
    File "/home/sam/.ansible/tmp/ansible-tmp-1427110003.65-277897441194582/authorized_key", line 385, in enforce_state
        parsed_new_key = (parsed_new_key[0], parsed_new_key[1], parsed_options, parsed_new_key[3])
    TypeError: 'NoneType' object has no attribute '__getitem__'

With this fix, I see the expected error instead:

    TASK: [authorized key test] ***************************************************
    failed: [localhost] => {"failed": true}
    msg: invalid key specified: /home/sam/.ssh/id_rsa.pub
2015-03-23 11:51:49 +00:00
Dag Wieers
0a91ace6ad Update authorized_key.py
Fix a (common) error in the examples. This is something that may go unnoticed during troubleshooting when copy&pasting the example.
2015-03-05 11:42:34 +01:00
Edward Larkey
4db27877bf Fix typo in authorized key module documentation.
Added opening double quote
2015-02-25 09:00:31 -06:00
Brian Coca
55b06568b0 added note that url src is only avaialable from 1.9 on 2015-02-12 09:31:45 -05:00
Toshio Kuratomi
b84f566ee7 Tabs to spaces 2015-02-11 14:05:49 -08:00
Jesse Keating
e0c5b4340d Add exclusive option to authorized_keys
This option allows the module to ensure that ONLY the specified keys
exist in the authorized_keys file. All others will be removed. This is
quite useful when rotating keys and ensuring no other key will be
accepted.
2015-02-09 17:05:38 -08:00
Jeff Gonzalez
27c046ae79 Refactored code to use module utility fetch_url function. 2015-02-03 19:08:23 -06:00
Jeff Gonzalez
e9ae165792 Added documentation for using url as key source 2015-01-27 15:06:55 -06:00
Jeff Gonzalez
54214f83b5 Added ability to use url as key source 2014-12-22 18:22:31 -06:00
Fabrice Bernhard
1ef8c26c0e Typo in comments
Credit goes to @kbsali 
@pborreli : you did not see that one? :-)
2014-11-27 12:36:34 +01:00
Michael DeHaan
c8e1a2077e file extensions! 2014-09-26 10:37:56 -04:00
Renamed from system/authorized_key (Browse further)