Forum Discussion

X2's avatar
X2
Moderator
4 years ago

Start/stop NetBackup with Ansible

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?

 

  • X2's avatar
    X2
    4 years ago

    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
    

     

6 Replies

  • 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.

     

    • X2's avatar
      X2
      Moderator

      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.

      • X2's avatar
        X2
        Moderator

        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.