On 28.01.2019 17:52, [email protected] wrote:
instance). But I don't know why the rescue tasks never runs.

And the role deploy-api/tasks/main.yml looks like this:

---
- block:
  - name: Create .ssh path for user
    become: yes
    file:
       path: "{{ deploy_path }}/.ssh"
       owner: example
       group: example
       state: directory
       mode: 0700
    tags:
      - backend
      - ssh

  - name: Upload RSA public key
    become: yes
    template:
      src: 'templates/example-id_rsa.pub'
      dest: "{{ deploy_path }}/.ssh/authorized_keys"
      owner: example
      group: example
      mode: 0640
    tags:
      - backend
      - ssh
[ ...More stuff... ]

- rescue:

Your syntax is wrong, rescue should not have a dash, check the documentation for correct syntax
https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1e5e34a35809bb5b7cd8824e01f54b80%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to