Can't disable jenkins on Debian Jessie using service module

21 views
Skip to first unread message

Jesús Alfredo Cambera

unread,
Sep 10, 2015, 8:51:57 AM9/10/15
to Ansible Project
Hi everybody,

I'm creating a playbook to install jenkins LTS (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
<jenkins> 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
<jenkins> 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
<jenkins> 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
<jenkins> 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
<jenkins> 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

Jesús Alfredo Cambera

unread,
Sep 10, 2015, 6:20:31 PM9/10/15
to Ansible Project
It seems like the bug has already been fixed on ansible 2.0: https://github.com/ansible/ansible-modules-core/pull/1905/files
Reply all
Reply to author
Forward
0 new messages