From 99a35b16645cfa09ee87eb6aafd2027a9dc35b22 Mon Sep 17 00:00:00 2001 From: Seige Date: Thu, 6 Jul 2023 05:23:32 +0100 Subject: [PATCH] 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 --------- Co-authored-by: Felix Fontein --- plugins/modules/github_key.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/modules/github_key.py b/plugins/modules/github_key.py index 17523eb89f..fa3a0a01fa 100644 --- a/plugins/modules/github_key.py +++ b/plugins/modules/github_key.py @@ -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