--- 
- name: "Copying CA and server certificate"
  shell: "cp -pvf /etc/easy-rsa/2.0/keys/ca.crt /etc/openvpn/; cp -pvf /etc/easy-rsa/2.0/keys/{{ inventory_hostname }}.crt /etc/openvpn/; cp -pvf /etc/easy-rsa/2.0/keys/{{ inventory_hostname }}.key /etc/openvpn/"
  args:
    creates: /etc/openvpn/ca.crt
- name: "Create symlink for Diffie Hellman"
  file: "src=/etc/easy-rsa/2.0/keys/dh512.pem dest=/etc/openvpn/dh512.pem state=link"
- name: "Copying server.conf to the OpenVPN server"
  template: src={{ item }} dest=/etc/openvpn/server.conf
  with_first_found:
    - files:
        - server.conf.j2
        - userConfig
        - defaultConfig
      paths:
        - ../templates/
        - ../files/
  notify: restart openvpn

