---
- name: copy logstash certificate to nodes
  hosts: all
  become: False
  tasks:
    - name: copy logstash-public.crt to node
      copy:
        src: logstash-{{ logstash_stack_name }}-public.crt
        dest: /tmp/logstash-{{ logstash_stack_name }}-public.crt
        mode: 0644
      when: logstash_stack_name is defined and logstash_stack_name | length > 0

- name: deploy safenode to genesis node
  hosts: all
  become: False
  vars:
    is_genesis: True
  roles:
    - role: safe_user
      become: True
    - {
        role: format_disk,
        become: True,
        block_device: "{{ block_device }}",
        mount_info:
          { name: "{{ node_data_mount_path }}", owner: "root", group: "root", mode: 0755 },
        when: provider == "aws"
      }
    - node-manager
    - genesis-node
