ansible / ansible.builtin / v2.9.27 / module / github_key Manage GitHub access keys. | "added in version" 2.2 of ansible.builtin" Authors: Robert Estelle (@erydo) preview | supported by communityansible.builtin.github_key (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Creates, removes, or updates GitHub access keys.
- name: Read SSH public key to authorize shell: cat /home/foo/.ssh/id_rsa.pub register: ssh_pub_key
- name: Authorize key with GitHub local_action: module: github_key name: Access Key for Some Machine token: '{{ github_access_token }}' pubkey: '{{ ssh_pub_key.stdout }}'
name: description: - SSH key name required: true force: default: 'yes' description: - The default is C(yes), which will replace the existing remote key if it's different than C(pubkey). If C(no), the key will only be set if no key with the given C(name) exists. type: bool state: choices: - present - absent default: present description: - Whether to remove a key, ensure that it exists, or update its value. token: description: - GitHub Access Token with permission to list and create public keys. required: true pubkey: description: - SSH public key value. Required when C(state=present).
deleted_keys: description: An array of key objects that were deleted. Only present on state=absent returned: When state=absent sample: - created_at: YYYY-MM-DDTHH:MM:SZ id: 0 key: BASE64 encoded key read_only: false url: http://example.com/github key type: list key: description: Metadata about the key just created. Only present on state=present returned: success sample: created_at: YYYY-MM-DDTHH:MM:SZ id: 0 key: BASE64 encoded key read_only: false url: http://example.com/github key type: dict matching_keys: description: An array of keys matching the specified name. Only present on state=present returned: When state=present sample: - created_at: YYYY-MM-DDTHH:MM:SZ id: 0 key: BASE64 encoded key read_only: false url: http://example.com/github key type: list