This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users migrated from #1, Jool Module not building, yet..
- Loading branch information
nold
committed
May 19, 2020
1 parent
e0825dc
commit 2dfb27b
Showing
7 changed files
with
60 additions
and
37 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.swp |
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
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
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
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
--- | ||
#FIXME: Create usernames using the pubkey filename | ||
- name: Clone SSH-Keys from Git | ||
git: | ||
repo: "{{ ssh_key_repo }}" | ||
dest: '/tmp/ffmd-ssh-keys' | ||
force: true | ||
version: 'master' | ||
|
||
# Fileglob shows all files matching pattern | ||
# Creates user for every pubkey | ||
- name: Create User Accounts & Set sudo-Group | ||
user: | ||
name: "{{ item }}" | ||
groups: "sudo" | ||
with_items: "{{ admin_users }}" | ||
|
||
- name: "[localhost] Clone SSH-Keys from Git" | ||
local_action: | ||
module: git | ||
repo: "{{ ssh_key_repo }}" | ||
dest: /tmp/ffmd-ssh-keys | ||
become: false | ||
name: "{{ item | basename | regex_replace('.pub','') }}" | ||
shell: '/bin/bash' | ||
createhome: true | ||
password_lock: true | ||
comment: 'Created with ansible from SSH pubkey repository' | ||
groups: 'sudo' | ||
append: true | ||
with_fileglob: | ||
- '/tmp/ffmd-ssh-keys/*.pub' | ||
|
||
- name: Add authorized_keys To All Users | ||
authorized_key: | ||
user: "{{ item }}" | ||
key: "{{ lookup('file', '/tmp/ffmd-ssh-keys/'+ item + '.pub') }}" | ||
with_items: "{{ admin_users }}" | ||
user: "{{ item | basename | regex_replace('.pub','') }}" | ||
key: "{{ lookup('file', item) }}" | ||
with_fileglob: | ||
- '/tmp/ffmd-ssh-keys/*.pub' |