# ssl certs - one task or two for IMAP and http?

**URL:** <https://forum.ansible.com/t/ssl-certs-one-task-or-two-for-imap-and-http/16366>\
**Category:** Ansible Project\
**Created:** [September 28, 2014, 7:01pm UTC](https://forum.ansible.com/t/ssl-certs-one-task-or-two-for-imap-and-http/16366 "2014-09-28T19:01:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Langille](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@Dan\_Langille](https://forum.ansible.com/u/Dan_Langille)\
**Post date:** [September 28, 2014, 7:01pm UTC](https://forum.ansible.com/t/ssl-certs-one-task-or-two-for-imap-and-http/16366/1 "2014-09-28T19:01:02Z")

</div>

At present, I have two tasks:

This one installs ssl certs for the host in question:

ssl-certificates/tasks/main.yml

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 28, 2014, 7:34pm UTC](https://forum.ansible.com/t/ssl-certs-one-task-or-two-for-imap-and-http/16366/2 "2014-09-28T19:34:53Z")

</div>

Unrelated, but here might be a possible tip to make a cleaner playbook:

vars:  
cert\_path: “{{ hosts/{{ inventory\_hostname }}/{{ inventory\_hostname }}.crt”  
key\_path: “hosts/{{ inventory\_hostname }}/{{ inventory\_hostname }}.nopassword.key”  
certs:

- path: “{{ cert\_path }}”  
mode: ‘644’
- path: “{{ key\_path }}”  
mode: ‘600’

tasks:

- name: certs  
copy: src={{item.path}} dest=/usr/local/etc/ssl/ owner=root group=www mode={{item.mode}} backup=yes  
with\_items: certs

I would tend to suggest your cert setup for dovecot to be in the dovecot role though, and other apps in their own.  
That way if something decides to get split out later, it’s a little bit more organized.

My two cents – but there may be some reasons for organizing it differently.
