---

- name: openvpn restart
  service: name={{openvpn_service}} state=reloaded
  when: not openvpn_only_keys

- name: openvpn pack clients
  command: zip -j {{openvpn_keydir}}/{{item.item}}.zip {{openvpn_keydir}}/{{item.item}}.crt {{openvpn_keydir}}/{{item.item}}.key {{openvpn_keydir}}/{{item.item}}.ovpn {{openvpn_keydir}}/ca.crt {{openvpn_tls_key if openvpn_tls_auth else ''}}
  with_items: >
    {{ openvpn_clients if (openvpn_ca_init_result.changed or openvpn_tls_key_result.changed)
       else openvpn_clients_changed.results|selectattr('changed')|map(attribute='item')|list }}

---

- name: openvpn restart
  service: name={{openvpn_service}} state=reloaded
  when: not openvpn_only_keys

- name: openvpn pack clients
  command: zip -j {{item.item}}.zip {{item.item}}.crt {{item.item}}.key {{item.item}}.ovpn ca.crt {{openvpn_tls_key if openvpn_tls_auth else ''}}
  args:
    chdir: "{{ openvpn_keydir }}"
  with_items: >
    {{ openvpn_clients if (openvpn_ca_init_result.changed or openvpn_tls_key_result.changed)
       else openvpn_clients_changed.results|selectattr('changed')|map(attribute='item')|list }}

Add ta.key to archive (alternate method)
Add ta.key to archive (alternate method)

This is an alternate way to ensure the ta.key file is zipped up in the
client config see #46
