ssl.yml 936 B

1234567891011121314151617181920212223242526272829
  1. ---
  2. # tasks/ssl.yml: Deploy the client SSL cert/key to client systems
  3. - include_vars: "{{ ansible_distribution }}.yml"
  4. - name: Ensure Sensu SSL directory exists
  5. file:
  6. dest: "{{ sensu_config_path }}/ssl"
  7. state: directory
  8. owner: "{{ sensu_user_name }}"
  9. group: "{{ sensu_group_name }}"
  10. when: sensu_ssl_manage_certs
  11. - include: "{{ role_path }}/tasks/ssl_generate.yml"
  12. when: sensu_ssl_gen_certs
  13. static: false
  14. - name: Deploy the Sensu client SSL cert/key
  15. copy:
  16. src: "{{ item.src }}"
  17. owner: "{{ sensu_user_name }}"
  18. remote_src: "{{ sensu_ssl_deploy_remote_src }}"
  19. group: "{{ sensu_group_name }}"
  20. dest: "{{ sensu_config_path }}/ssl/{{ item.dest }}"
  21. with_items:
  22. - {src: "{{ sensu_ssl_client_cert }}", dest: cert.pem}
  23. - {src: "{{ sensu_ssl_client_key }}", dest: key.pem}
  24. notify: restart sensu-client service
  25. when: sensu_ssl_manage_certs