---
- name: "Install postgres via include_role"
  include_role:
    name: postgres

- name: "Copy restore script to restore server"
  copy:
    src: restore.sh
    dest: '/root/restore.sh'
    mode: 0754
    owner: root
    group: root

- name: "Create file for gpg secret key"
  become: yes
  copy:
    dest: '/root/gpg_private_key'
    mode: '0600'
    owner: 'root'
    group: 'root'
    content: |
      {{ gpg_key_smardigo_automation__private }}

- name: "Import private gpg key" # noqa command-instead-of-shell
  become: yes
  shell: 'gpg --import /root/gpg_private_key'
  register: gpg_import
  changed_when:
    - gpg_import.rc != '0'
