diff options
author | B Stack <bgstack15@gmail.com> | 2016-09-23 10:27:15 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2016-09-23 10:27:15 -0400 |
commit | 5e8a7ac51e486044c8d14694e5f51173dd63f628 (patch) | |
tree | 586bba6cab996f95a39f6a4620e457cf5924d770 /roles/ssh_keys/tasks/main.yml.2016-09-22.03 | |
parent | Initial file upload (diff) | |
download | ansible01-5e8a7ac51e486044c8d14694e5f51173dd63f628.tar.gz ansible01-5e8a7ac51e486044c8d14694e5f51173dd63f628.tar.bz2 ansible01-5e8a7ac51e486044c8d14694e5f51173dd63f628.zip |
Initial file upload
Diffstat (limited to 'roles/ssh_keys/tasks/main.yml.2016-09-22.03')
-rw-r--r-- | roles/ssh_keys/tasks/main.yml.2016-09-22.03 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/roles/ssh_keys/tasks/main.yml.2016-09-22.03 b/roles/ssh_keys/tasks/main.yml.2016-09-22.03 new file mode 100644 index 0000000..3729179 --- /dev/null +++ b/roles/ssh_keys/tasks/main.yml.2016-09-22.03 @@ -0,0 +1,40 @@ +--- +- 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 + +#- shell: echo "{{ item | basename | regex_replace('\.pubkeys?$','') }}" +# with_fileglob: +# - '*.pubkey' +# - '*.pubkeys' +# register: users_to_check + +#- debug: var=ssh_key_strings +#- debug: var=ssh_key_files + +- stat: path='{{ master_home_dir}}/{{ item.user }}/.ssh' + with_items: + - '{{ ssh_key_files }}' + register: "r" + +#- debug: msg='{{ item.stat.exists }}' +# with_flattened: +# - '{{ r.results }}' + +- name: ssh_keys deploy keys from files + template: + src: "roles/ssh_keys/files/{{ item.item.file }}" + dest: '{{ master_home_dir}}/{{ item.item.user }}/.ssh/authorized_keys' + mode: 0600 + owner: '{{ item.item.user }}' + with_items: + - '{{ r.results }}' + when: + - '{{ item.stat.exists }}' + +- name: ssh_keys deploy keys from |