Hi all,
I’m new to Ansible, so I’m testing it out by configuring a new router running OpenWRT.
Unfortunately I have gotten stuck pretty early in the process! I have created a playbook to install the BIND daemon and start it, but it keeps complaining that it can’t start it because the service name is not recognised.
I thought that if I could see the command Ansible is trying to run it might shed some light on what’s going wrong, but despite turning logging on and running in verbose mode, all I can see are the SSH commands run on the Ansible machine, not the commands being run on the target machine. (I can see some scripts being run on the target over SSH but they are deleted before I can inspect them.)
How can I see what commands are actually being run on the target machine?
As far as the actual error is concerned, this task is failing:
- name: Start BIND service
service: name=named state=started enabled=true
With this error:
failed: [target] => {“failed”: true, “item”: “”}
msg: service name not recognized
I’m not sure why it says the service name is unrecognised, because I can start it from the target machine’s command line without any problems:
root@target:~# /etc/init.d/named start
Starting isc-bind
I am guessing Ansible does not know how to start services on the OpenWRT distro, but I’m not sure since I can’t see what command it is trying to run. The docs for the “service” module don’t have any way of specifying what sort of init system is in use, so I’m guessing it’s auto-detected and that’s failing.
Any suggestions about how to enable and start services under OpenWRT with Ansible?
Many thanks,
Adam.