10-05-2020 11:17 AM
Calling on Ansible experts:
I created an Ansible playbook to "standardize" our Linux client NetBackup configuration after initial install. The configuration steps work fine except that I'm having difficulties to shutdown/startup of NetBackup. Below the is part of playbook which I use:
- name: Stop NetBackup service: name: netbackup state: stopped
...
- name: Start NetBackup service: name: netbackup state: started
I have also tried by adding a 30 second pause after this task but it didn't help.
Below is the Anisible's warning for shutdown of NetBackup
TASK [Stop NetBackup] ********************************************************** [WARNING]: The service (netbackup) is actually an init script but the system is managed by systemd
and for startup:
TASK [Start NetBackup] ********************************************************* fatal: [orford.it.mcgill.ca]: FAILED! => {"changed": false, "msg": "Unable to start service netbackup: Failed to start netbackup.service: Unit not found.\n"}
Any suggestions?
Solved! Go to Solution.
10-23-2020 10:01 AM
@vtas_chas apologies for the late reply. No infoscale on the client. These are standard VMs on vSphere without Infoscale. I haven't tried this on our Solaris servers but they are provisioned so rarely!
As a workaround, I ended up using sysvinit module rather than service or systemd.
- name: Stop NetBackup (initd) sysvinit: name: netbackup state: stopped
10-06-2020 07:55 AM
Not 100% sure, but the error makes me think the init script isn't enabled for systemd. Have you enabled the NetBackup service being managed by systemd?
The other thing could be the way you're dealing with the service. IIRC, you can do this:
- name: Stop NetBackup
systemd:
name: netbackup
state: stopped
As long as the service has been enabled (systemctl enable netbackup) and the symlinks are there, that may fix your problem.
10-08-2020 05:35 AM
@vtas_chas Thanks for the reply.
I will try that out on my test system.
NB: Starting and stopping NetBackup using command "service netbackup start" via ssh works fine. However, when the system is rebooted, NetBackup does not start. I had a case opened earlier and InfoScale engineering team gave me a fix. But when Infoscale was upgraded to a newer version, the fix was not in it.
10-09-2020 09:13 AM
@vtas_chas tried your suggestion yesterday and the behaviour was the same. Ansible came back with the same response. NetBackup did not go down. Maybe I will try with a pause of a few seconds after the task and see if it changes anything.
10-12-2020 06:38 AM
The pause is a good idea. Depending on what's going on in the system, services can take some time.
I'm curious about the InfoScale team comment -- is this on a cluster or you're running Infoscale on the client?
10-23-2020 10:01 AM
@vtas_chas apologies for the late reply. No infoscale on the client. These are standard VMs on vSphere without Infoscale. I haven't tried this on our Solaris servers but they are provisioned so rarely!
As a workaround, I ended up using sysvinit module rather than service or systemd.
- name: Stop NetBackup (initd) sysvinit: name: netbackup state: stopped
10-26-2020 06:34 AM
Yeah, I was wondering what happened. Thanks for updating, X2. My next suggestion would be to test with sysvinit, glad it worked.
The issue we run into, and everyone has to remember, is that once we get out of the actual API, the number of variables skyrockets from environment to environment and so using the 3rd party tools one way in one environment doesn't necessarily translate precisely the same way in another. That's part of why we are trying to bring more attention to the API set and get more collaboration from customers / partners here and on GitHub. What you guys all do in your environments is impossible for us truly replicate in any of ours, so that interaction becomes really important.
Keep the conversation and questions coming!