# Ansible Service Module and sudo

**URL:** <https://forum.ansible.com/t/ansible-service-module-and-sudo/20379>\
**Category:** Ansible Project\
**Created:** [January 29, 2016, 8:55am UTC](https://forum.ansible.com/t/ansible-service-module-and-sudo/20379 "2016-01-29T08:55:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isa](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@Isa](https://forum.ansible.com/u/Isa)\
**Post date:** [January 29, 2016, 8:55am UTC](https://forum.ansible.com/t/ansible-service-module-and-sudo/20379/1 "2016-01-29T08:55:58Z")

</div>

Hi All

I am trying to user a systemd service with ansible. Basically I am trying to restart jboss with a jboss user. I have allowed this user to stop/start/ using sudo without a password in the sudoers file and it works

`  
sudo /usr/bin/systemctl stop jboss

`

. When I try with ansible I get Access denied

`

---

<div class="post-metadata">

**Author:** ![Jerome\_Warnier](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@Jerome\_Warnier](https://forum.ansible.com/u/Jerome_Warnier)\
**Post date:** [January 26, 2018, 8:26am UTC](https://forum.ansible.com/t/ansible-service-module-and-sudo/20379/2 "2018-01-26T08:26:46Z")

</div>

This is a known issue, see: Le vendredi 29 janvier 2016 14:55:02 UTC+1, Isa Baboo a écrit :
