---

- include_role:
    name: evolix/remount-usr

- name: Create CSR dir
  file:
    path: "{{ evoacme_csr_dir }}"
    state: directory
    owner: root
    group: root
    mode: "0755"

- name: Copy make-csr.sh script
  copy:
    src: make-csr.sh
    dest: /usr/local/sbin/make-csr
    owner: root
    group: root
    mode: "0755"

- name: Copy vhost-domains.sh script
  copy:
    src: vhost-domains.sh
    dest: /usr/local/sbin/vhost-domains
    owner: root
    group: root
    mode: "0755"

- name: Copy evoacme script
  copy:
    src: evoacme.sh
    dest: /usr/local/sbin/evoacme
    owner: root
    group: root
    mode: "0755"

- name: Delete scripts in old location
  file:
    path: "/usr/local/bin/{{ item }}"
    state: absent
  loop:
    - 'make-csr'
    - 'evoacme'
