Skip to content

Instantly share code, notes, and snippets.

@visualskyrim
Created November 9, 2017 06:28
Show Gist options
  • Save visualskyrim/7af3a21d7b6b4375274f2d6664f30015 to your computer and use it in GitHub Desktop.
Save visualskyrim/7af3a21d7b6b4375274f2d6664f30015 to your computer and use it in GitHub Desktop.
deploy_public_key_as_same_user.yml
---
- hosts: all
tasks:
- name: make direcotry
file:
path: "/home/<username>/.ssh"
state: directory
- name: create empty file
file:
path: "/home/<username>/.ssh/authorized_keys"
state: touch
- name: put pubkey
lineinfile:
path: "/home/<username>/.ssh/authorized_keys"
line: "{{ pubkey }}"
@blackdogbarking
Copy link

Hi @visualskyrim, I've corrected a typo in my fork. Pull if you like, or just change "direcotry" to "directory"

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