aboutsummaryrefslogtreecommitdiff
path: root/roles/ldap_certs/tasks/main.yml
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2016-10-06 15:22:05 -0400
committerB Stack <bgstack15@gmail.com>2016-10-06 15:22:05 -0400
commit2c3fb0d51f0e1044eaca306cc74045b01a202891 (patch)
tree83bb69098cfc5d07d3a5ceb27794f1a2fbaae00b /roles/ldap_certs/tasks/main.yml
parentFixed a few things, added ldap_certs stub (diff)
downloadansible01-master.tar.gz
ansible01-master.tar.bz2
ansible01-master.zip
built ldap_certs, fixed sudo taskHEADmaster
Diffstat (limited to 'roles/ldap_certs/tasks/main.yml')
-rw-r--r--roles/ldap_certs/tasks/main.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/ldap_certs/tasks/main.yml b/roles/ldap_certs/tasks/main.yml
index 685cd79..a088b38 100644
--- a/roles/ldap_certs/tasks/main.yml
+++ b/roles/ldap_certs/tasks/main.yml
@@ -14,3 +14,41 @@
- files:
- 'roles/ldap_certs/hosts/{{ ansible_fqdn }}.yml'
skip: true
+
+- name: ldap_certs deploy files that exist
+ template: src='{{ item.file }}' dest='{{ ldap_certs_cert_dir }}/{{ item.file | regex_replace('.*/','') }}' owner='{{ ldap_certs_owner }}' group='{{ ldap_certs_group }}' mode=0644 #'
+ with_items:
+ - '{{ ldap_certs }}'
+ when:
+ - ( not '{{ item.exists | lower }}' == 'false' )
+ - ldap_certs is defined
+
+- name: ldap_certs remove files that should not exist
+ file: path='{{ ldap_certs_cert_dir }}/{{ item.file | regex_replace('.*/','') }}' state='absent'
+ with_items:
+ - '{{ ldap_certs }}'
+ when:
+ - ( not '{{ item.exists }}' ) or ( '{{ item.exists | lower }}' == 'false' )
+ - ldap_certs is defined
+
+- name: ldap_certs get hash values
+ command: openssl x509 -in "{{ ldap_certs_cert_dir }}/{{ item.file | regex_replace('.*/','') }}" -hash -noout
+ register: hashes
+ with_items:
+ - '{{ ldap_certs }}'
+ when:
+ - '{{ item.exists }}'
+ - ( not '{{ item.gets_hashlink | lower }}' == 'false' )
+ - ldap_certs is defined
+
+- name: ldap_certs deploy hashlink files
+ file:
+ path: "{{ ldap_certs_hashlink_dir }}/{{ item.stdout | quote }}.0"
+ src: "{{ ldap_certs_cert_dir}}/{{ item.item.file | regex_replace('.*/','') }}"
+ state: 'link'
+ with_items:
+ - '{{ hashes.results }}'
+ when:
+ - hashes is defined
+ - item.stdout is defined
+ - ldap_certs is defined
bgstack15