# Can't disable jenkins on Debian Jessie using service module

**URL:** <https://forum.ansible.com/t/cant-disable-jenkins-on-debian-jessie-using-service-module/19229>\
**Category:** Ansible Project\
**Created:** [September 10, 2015, 12:47pm UTC](https://forum.ansible.com/t/cant-disable-jenkins-on-debian-jessie-using-service-module/19229 "2015-09-10T12:47:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesus\_Alfredo\_Camber](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jesus\_Alfredo\_Camber](https://forum.ansible.com/u/Jesus_Alfredo_Camber)\
**Post date:** [September 10, 2015, 12:47pm UTC](https://forum.ansible.com/t/cant-disable-jenkins-on-debian-jessie-using-service-module/19229/1 "2015-09-10T12:47:04Z")

</div>

Hi everybody,

I’m creating a playbook to install jenkins LTS ([http://pkg.jenkins-ci.org/debian-stable/](http://pkg.jenkins-ci.org/debian-stable/)) on Debian Jessie. Everything seems to be working fine except when I try to disable the jenkins. I using Debian Jessie on mgmt and Jessie nodes:

`  
vagrant@mgmt:~$ ansible --version  
ansible 1.9.3  
configured module search path = None  
vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig jenkins”  
jenkins on  
vagrant@mgmt:~$ ansible -m service -a “name=jenkins enabled=no” jenkins -vv -s  
 REMOTE\_MODULE service name=jenkins enabled=no  
jenkins | success \>\> {  
“changed”: false,  
“enabled”: false,  
“name”: “jenkins”  
}

vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig jenkins”  
jenkins on  
vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig jenkins off”  
vagrant@mgmt:~$ ansible -m service -a “name=jenkins enabled=yes” jenkins -vv -s  
 REMOTE\_MODULE service name=jenkins enabled=yes  
jenkins | success \>\> {  
“changed”: true,  
“enabled”: true,  
“name”: “jenkins”  
}

vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig jenkins”  
jenkins on  
vagrant@mgmt:~$ ansible -m service -a “name=jenkins enabled=no” jenkins -vv -s  
 REMOTE\_MODULE service name=jenkins enabled=no  
jenkins | success \>\> {  
“changed”: false,  
“enabled”: false,  
“name”: “jenkins”  
}

vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig jenkins”  
jenkins on  
`

I repeated the same test using a distro package and everything seems to be working fine:

`  
vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig nginx”  
nginx on  
vagrant@mgmt:~$ ansible -m service -a “name=nginx enabled=no” jenkins -vv -s  
 REMOTE\_MODULE service name=nginx enabled=no  
jenkins | success \>\> {  
“changed”: true,  
“enabled”: false,  
“name”: “nginx”  
}

vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig nginx”  
nginx off  
vagrant@mgmt:~$ ansible -m service -a “name=nginx enabled=yes” jenkins -vv -s  
 REMOTE\_MODULE service name=nginx enabled=yes  
jenkins | success \>\> {  
“changed”: true,  
“enabled”: true,  
“name”: “nginx”  
}

vagrant@mgmt:~$ ssh jenkins “sudo -u root chkconfig nginx”  
nginx on  
`

So my question is: What do ansible do to disable services on Debian Jessie? How can i debug this issue? I tried with “-vvv” but I didn’t get any useful information.

I presume that there may be a bug on the jenkins debian package but I need more info to try to fix it.

Thanks in advance,

Alfredo

---

<div class="post-metadata">

**Author:** ![Jesus\_Alfredo\_Camber](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jesus\_Alfredo\_Camber](https://forum.ansible.com/u/Jesus_Alfredo_Camber)\
**Post date:** [September 10, 2015, 10:20pm UTC](https://forum.ansible.com/t/cant-disable-jenkins-on-debian-jessie-using-service-module/19229/2 "2015-09-10T22:20:31Z")

</div>

It seems like the bug has already been fixed on ansible 2.0: [https://github.com/ansible/ansible-modules-core/pull/1905/files](https://github.com/ansible/ansible-modules-core/pull/1905/files)
