# set up ssh access to bitbucket
- name: setup access to bitbucket
import_role:
name: bitbucketSetup
creates: /home/ian/.ssh/id_rsa.pub
# so skipped if executed elsewhere
This fails with the error
"conflicting action statements: import_role, creates"
I have tried "include_role" which also errors "conflicting action statements".
Just for the record, the role does indeed create the file, and I do only want it run if the file does not exist. I think the error is a bug, but I am not familiar enough with Ansible, to be sure.
The setup may have been run in a previous playbook,
or from a role earlier in this playbook, or even on an earlier run of this playbook. In these cases it should not be run again.
How can I do this, without using stat, register and testing the result, which is horribly slow.
name: setup access to bitbucket
import_role:
name: bitbucketSetup
creates: /home/ian/.ssh/id_rsa.pub
so skipped if executed elsewhere
This fails with the error
“conflicting action statements: import_role, creates”
I have tried “include_role” which also errors “conflicting action
statements”.
Just for the record, the role does indeed create the file, and I do only
want it run if the file does not exist. I think the error is a bug, but
I am not familiar enough with Ansible, to be sure.
The setup may have been run in a previous playbook,
or from a role earlier in this playbook, or even on an earlier run of
this playbook. In these cases it should not be run again.
How can I do this, without using stat, register and testing the result,
which is horribly slow.
I think that is the way to go though.
Neither import_role nor include_role supports ‘creates’.
Why would that be horribly slow?