Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blackdogbarking/1a45de939af027572a9328b6f6166dec to your computer and use it in GitHub Desktop.
Save blackdogbarking/1a45de939af027572a9328b6f6166dec to your computer and use it in GitHub Desktop.
---
- hosts: all
become: true
become_user: "super-user"
tasks:
- name: make directory
file:
path: "/home/<super-user>/.ssh"
state: directory
- name: create empty file
file:
path: "/home/<super-user>/.ssh/authorized_keys"
state: touch
- name: put pubkey
lineinfile:
path: "/home/<super-user>/.ssh/authorized_keys"
line: "{{ pubkey }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment