Add example for github_key in a single task (#6854)

* Add example for github_key in a single task

* Update plugins/modules/github_key.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Seige
2023-07-06 05:23:32 +01:00
committed by GitHub
parent 4d704c03df
commit 99a35b1664

View File

@@ -82,8 +82,14 @@ EXAMPLES = '''
name: Access Key for Some Machine
token: '{{ github_access_token }}'
pubkey: '{{ ssh_pub_key.stdout }}'
'''
# Alternatively, a single task can be used reading a key from a file on the controller
- name: Authorize key with GitHub
community.general.github_key:
name: Access Key for Some Machine
token: '{{ github_access_token }}'
pubkey: "{{ lookup('ansible.builtin.file', '/home/foo/.ssh/id_rsa.pub') }}"
'''
import json
import re