mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #6854/99a35b16 backport][stable-6] Add example for github_key in a single task (#6859)
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>
(cherry picked from commit 99a35b1664
)
Co-authored-by: Seige <charliefjennings+git@gmail.com>
This commit is contained in:
parent
feb8d421dc
commit
6ff4b479ab
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue