---
- name: Generate openshift etcd certs
  become: yes
  include_role:
    name: etcd
    tasks_from: client_certificates.yml
  vars:
    etcd_cert_prefix: "{{ nuage_etcd_cert_prefix }}"
    etcd_cert_config_dir: "{{ cert_output_dir }}"
    etcd_cert_subdir: "openshift-nuage-{{ openshift.common.hostname }}"
    etcd_certificates_redeploy: true


- name: Error if etcd certs are not copied
  stat:
    path: "{{ item }}"
    get_checksum: false
    get_attributes: false
    get_mime: false
  with_items:
  - "{{ cert_output_dir }}/{{ nuage_etcd_cert_prefix }}-ca.crt"
  - "{{ cert_output_dir }}/{{ nuage_etcd_cert_prefix }}-client.crt"
  - "{{ cert_output_dir }}/{{ nuage_etcd_cert_prefix }}-client.key"
