diff --git a/changelogs/fragments/255_authorized_key_url.yml b/changelogs/fragments/255_authorized_key_url.yml new file mode 100644 index 0000000..556f13b --- /dev/null +++ b/changelogs/fragments/255_authorized_key_url.yml @@ -0,0 +1,3 @@ +--- +trivial: +- authorized_keys - add example involving lookup.url diff --git a/plugins/modules/authorized_key.py b/plugins/modules/authorized_key.py index 7f203e3..e11b416 100644 --- a/plugins/modules/authorized_key.py +++ b/plugins/modules/authorized_key.py @@ -94,6 +94,12 @@ EXAMPLES = r''' state: present key: https://github.com/charlie.keys +- name: Set authorized keys taken from url using lookup + ansible.posix.authorized_key: + user: charlie + state: present + key: "{{ lookup('url', 'https://github.com/charlie.keys', split_lines=False) }}" + - name: Set authorized key in alternate location ansible.posix.authorized_key: user: charlie