# Become plugin

**URL:** <https://forum.ansible.com/t/become-plugin/31406>\
**Category:** Ansible Developer\
**Created:** [October 2, 2019, 7:58am UTC](https://forum.ansible.com/t/become-plugin/31406 "2019-10-02T07:58:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torrpenn356](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Torrpenn356](https://forum.ansible.com/u/Torrpenn356)\
**Post date:** [October 2, 2019, 7:58am UTC](https://forum.ansible.com/t/become-plugin/31406/1 "2019-10-02T07:58:02Z")

</div>

Hello,  
I hope, I am posting my question on the right group, if not, please tell me  
I need to use a dedicated become method and want to know, if it is possible, or, if only the “official” ones are authorized.  
If it is possible, is there specific guidelines to follow to develop my own become plugin  
Thanks and regards  
R

---

<div class="post-metadata">

**Author:** ![zoobarb](https://avatars.discourse-cdn.com/v4/letter/z/b2d939/32.png) [@zoobarb](https://forum.ansible.com/u/zoobarb)\
**Post date:** [February 12, 2020, 7:28pm UTC](https://forum.ansible.com/t/become-plugin/31406/2 "2020-02-12T19:28:01Z")

</div>

Here are the official docs…but, I am unable to find anything specific to “become” plugin development.

[https://docs.ansible.com/ansible/latest/dev\_guide/developing\_plugins.html#writing-plugins-in-python](https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html#writing-plugins-in-python)

---

<div class="post-metadata">

**Author:** ![sdoran](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sdoran](https://forum.ansible.com/u/sdoran)\
**Post date:** [February 13, 2020, 8:11pm UTC](https://forum.ansible.com/t/become-plugin/31406/3 "2020-02-13T20:11:06Z")

</div>

We unfortunately don’t have docs specific to developing become plugins. They are pretty straightforward compared to other plugin types, though. I would recommend [looking at the existing become plugins](https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/become) to get an idea of how to write you own. You can ask development questions here or on Freennode IRC in #ansible-devel.

---

<div class="post-metadata">

**Author:** ![zoobarb](https://avatars.discourse-cdn.com/v4/letter/z/b2d939/32.png) [@zoobarb](https://forum.ansible.com/u/zoobarb)\
**Post date:** [February 13, 2020, 8:45pm UTC](https://forum.ansible.com/t/become-plugin/31406/4 "2020-02-13T20:45:32Z")

</div>

Excellent. Thank you.

I did copy and then edit the sudo one to meet my needs I believe, unfortunately my unfamiliarity with ansible has me at a loss for how to correctly make it accessible to the playbook.

I placed it here “/usr/share/ansible/plugins/”

And added this to my ansible config: ANSIBLE\_LIBRARY=$ANSIBLE\_LIBRARY:/usr/share/ansible/plugins

-bash-4.2$ ls -l /usr/share/ansible/plugins/suexec.py

-rw-r–r–. 1 root root 3526 Feb 12 14:40 /usr/share/ansible/plugins/suexec.py

This is what the ansible developer docs suggested or at least was one of the suggestions. I clearly missed something though.

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

fatal: [desktop]: FAILED! =\> {“msg”: “Privilege escalation method not found: suexec”}

Any guidance is greatly appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 30, 2020, 5:44pm UTC](https://forum.ansible.com/t/become-plugin/31406/5 "2020-03-30T17:44:49Z")

</div>

It needs a specific subdir for each plugin type, otherwise there would  
be name conflicts across plugins.

See [https://docs.ansible.com/ansible/latest/dev\_guide/developing\_locally.html#local-plugins](https://docs.ansible.com/ansible/latest/dev_guide/developing_locally.html#local-plugins)

---

<div class="post-metadata">

**Author:** ![Pradeep\_Tiwari](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@Pradeep\_Tiwari](https://forum.ansible.com/u/Pradeep_Tiwari)\
**Post date:** [April 19, 2020, 7:11pm UTC](https://forum.ansible.com/t/become-plugin/31406/6 "2020-04-19T19:11:04Z")

</div>

Hi,

Could you please confirm if it is working for you. Please share the code if it is working along with instructions. Thank you.
