Last active
June 1, 2021 14:25
-
-
Save TomKeur/5923e133b786c7f9711c48ceef5c97fc to your computer and use it in GitHub Desktop.
Linux public keys #ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
vars_files: | |
- ../vars/public_keys.yml | |
tasks: | |
- name: Linux users authorized public keys | |
authorized_key: | |
user: "{{ ansible_user }}" | |
state: present | |
key: "{{ lookup('file', item) }}" | |
with_items: | |
- "{{ authorized_pubkeys }}" | |
- name: Linux users revoke public keys | |
authorized_key: | |
user: "{{ ansible_user }}" | |
state: absent | |
key: "{{ lookup('file', item) }}" | |
with_items: | |
- "{{ revoked_pubkeys }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
public_keys.yml: https://gist.github.com/TomKeur/82d88251c3ef85d0cc2d55be8972fa7d