# Work around needed for possible bug.

**URL:** <https://forum.ansible.com/t/work-around-needed-for-possible-bug/36986>\
**Category:** Ansible Project\
**Created:** [August 14, 2022, 4:06am UTC](https://forum.ansible.com/t/work-around-needed-for-possible-bug/36986 "2022-08-14T04:06:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HobsonI](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/hobsoni/32/4960_2.png) [@HobsonI](https://forum.ansible.com/u/HobsonI)\
**Post date:** [August 14, 2022, 4:06am UTC](https://forum.ansible.com/t/work-around-needed-for-possible-bug/36986/1 "2022-08-14T04:06:38Z")

</div>

Hi,

I have a playbook, with a task that reads:

# set up ssh access to bitbucket  
- name: setup access to bitbucket  
&nbsp;&nbsp;&nbsp;import\_role:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: bitbucketSetup  
&nbsp;&nbsp;&nbsp;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.

Many thanks

Ian

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [August 14, 2022, 6:28am UTC](https://forum.ansible.com/t/work-around-needed-for-possible-bug/36986/2 "2022-08-14T06:28:45Z")

</div>

> Hi,
> 
> I have a playbook, with a task that reads:
> 
> # 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.

I think that is the way to go though.  
Neither import\_role nor include\_role supports ‘creates’.  
Why would that be horribly slow?

---

<div class="post-metadata">

**Author:** ![amitchettri](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/amitchettri/32/404_2.png) [@amitchettri](https://forum.ansible.com/u/amitchettri)\
**Post date:** [August 14, 2022, 10:02am UTC](https://forum.ansible.com/t/work-around-needed-for-possible-bug/36986/3 "2022-08-14T10:02:16Z")

</div>

Hi Ian,

Either your yaml is not properly indented or you have the wrong parameter/action with the module in used.

What i see from your statement below you have “create” as parameter/action in the import\_role.

Can you confirm the use of creates. Also it would help if you can kind of put snap of code and error.

- name: setup access to bitbucket  
import\_role:  
name: bitbucketSetup  
creates: /home/ian/.ssh/id\_rsa.pub

Regards  
Amit.

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [August 15, 2022, 12:08pm UTC](https://forum.ansible.com/t/work-around-needed-for-possible-bug/36986/4 "2022-08-15T12:08:27Z")

</div>

Shouldn’t the role itself handle whether or not BitBucket is already set up? Shouldn’t the role itself be idempotent?
