Ansible Service Module and sudo

1,063 views
Skip to first unread message

Isa Baboo

unread,
Jan 29, 2016, 8:55:02 AM1/29/16
to Ansible Project
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

---
- hosts: isa
  tasks
:
 
- name: make sure jboss is running
    service
: name=jboss state=running



So I tried running the playbook with the become option

---
- hosts: isa
  tasks
:
 
- name: make sure jboss is running
    service
: name=jboss state=running
    become
: yes
                                         


Now I get this message

=> Missing become password

As I mentioned the sudoers file do not require a password for this command so How to I get ansible run this?

Jérôme Warnier

unread,
Jan 26, 2018, 3:26:46 AM1/26/18
to Ansible Project
This is a known issue, see: https://github.com/ansible/ansible/issues/5712

Hope it helps.

Reply all
Reply to author
Forward
0 new messages