Created
March 7, 2016 12:24
-
-
Save tuxnker/c00eb26979f90daf851e to your computer and use it in GitHub Desktop.
This file contains 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 | |
# remote_user: | |
sudo: yes | |
sudo_user: root | |
tasks: | |
- script: lsuser-wrapper.sh creates=/tmp/lsuser | |
- shell: 'getent passwd|egrep "bash|zsh|nologin" |cut -d : -f 6' | |
register: home_folder | |
- fetch: src=/tmp/lsuser dest=reports/remote-authorized/lsuser-{{ ansible_hostname }} flat=yes | |
- file: path=/tmp/lsuser state=absent | |
- fetch: src={{ item }}/.ssh/authorized_keys dest=reports/remote-authorized/{{ ansible_hostname }}{{ item|replace('/', '_')}}.txt flat=yes | |
with_items: home_folder.stdout.split() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment