Exemplo n.º 1
0
        def runme(doit):

            args = module.params['arguments']
            cmd = "%s %s %s" % (script, doit, "" if args is None else args)

            # how to run
            if module.params['daemonize']:
                (rc, out, err) = daemonize(cmd)
            else:
                (rc, out, err) = module.run_command(cmd)
            # FIXME: ERRORS

            if rc != 0:
                module.fail_json(msg="Failed to %s service: %s" % (action, name), rc=rc, stdout=out, stderr=err)

            return (rc, out, err)
Exemplo n.º 2
0
        def runme(doit):

            cmd = "%s %s %s %s" % (script, doit, name,
                                   module.params['arguments'])
            # how to run
            if module.params['daemonize']:
                (rc, out, err) = daemonize(cmd)
            else:
                (rc, out, err) = module.run_command(cmd)
            # FIXME: ERRORS

            if rc != 0:
                module.fail_json(msg="Failed to %s service: %s" %
                                 (action, name))

            return (rc, out, err)