Created
August 19, 2017 13:44
-
-
Save ridingintraffic/a89b8a27cb6b9148c5bf7f9dd4294c35 to your computer and use it in GitHub Desktop.
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
- name: "Set up authorized_keys for the root user" | |
hosts: pi | |
user: pi | |
tasks: | |
- name: Create new ssh key-pair | |
local_action: command ssh-keygen -t rsa -N "" -q -f ~/test/id_rsa | |
- name: Set up authorized_keys for the pi user | |
#authorized_key: user=pi key="{{ item }}" state=present exclusive=yes | |
authorized_key: user=pi key="{{ item }}" state=present exclusive=yes | |
with_file: | |
- ~/test/id_rsa.pub | |
- name: move key-pair | |
local_action: command mv ~/test/id_rsa ~/test/id_rsa.bak | |
run_once: true | |
- name: move key-pair | |
local_action: command mv ~/test/id_rsa.pub ~/test/id_rsa.pub.bak | |
run_once: true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment