Skip to content

Instantly share code, notes, and snippets.

@TomKeur
Last active June 1, 2021 14:25
Show Gist options
  • Save TomKeur/5923e133b786c7f9711c48ceef5c97fc to your computer and use it in GitHub Desktop.
Save TomKeur/5923e133b786c7f9711c48ceef5c97fc to your computer and use it in GitHub Desktop.
Linux public keys #ansible
---
- 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 }}"
@TomKeur
Copy link
Author

TomKeur commented Nov 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment