aboutsummaryrefslogtreecommitdiff
path: root/roles/ssh_keys/tasks/main.yml.2016-09-22.01
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ssh_keys/tasks/main.yml.2016-09-22.01')
-rw-r--r--roles/ssh_keys/tasks/main.yml.2016-09-22.0126
1 files changed, 26 insertions, 0 deletions
diff --git a/roles/ssh_keys/tasks/main.yml.2016-09-22.01 b/roles/ssh_keys/tasks/main.yml.2016-09-22.01
new file mode 100644
index 0000000..b9536c4
--- /dev/null
+++ b/roles/ssh_keys/tasks/main.yml.2016-09-22.01
@@ -0,0 +1,26 @@
+---
+- name: ssh_keys get vars
+ include_vars: default.yml
+
+- name: ssh_keys get OS vars
+ include_vars: '{{ item }}'
+ with_first_found:
+ - '{{ ansible_distribution }}.yml'
+ - default.yml
+
+- stat: path='{{ master_home_dir }}/{{ item | basename | regex_replace('\.pubkeys?$','') }}/.ssh'
+ register: files_stat
+ with_fileglob:
+ - '*.pubkey'
+ - '*.pubkeys'
+
+- debug: var='{{ item.stat.exists }}'
+ with_items: '{{ files_stat.results }}'
+
+- name: ssh_keys deploy keys
+ template: src='{{ item }}' dest='{{ master_home_dir }}/{{ item | basename | regex_replace('\.pubkeys?$','') }}/.ssh/authorized_keys' mode=0600 owner='{{ item | basename | regex_replace('\.pubkeys?$',"") }}'
+ with_fileglob:
+ - '*.pubkey'
+ - '*.pubkeys'
+ #when: item2.stat.exists
+ #with_items: '{{ files_stat.results }}'
bgstack15