neillturner / kitchen-ansible

Ansible Provisioner for Test Kitchen
Other
350 stars 134 forks source link

shell command produces different results #314

Open nevafuse opened 4 years ago

nevafuse commented 4 years ago

I have an executable I need to run. It executes fine if I use the shell provisioner in kitchen or use ansible shell/command module directly against the host. But if I use this provisioner, it returns a different result. Unfortunately, it is closed-sourced so I can't really debug it using that. I have reached out to the owners of the executable to see if they can help troubleshoot.

Using this provisioner

Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
       Pipelining is enabled.
       <testing-self-service> ESTABLISH LOCAL CONNECTION FOR USER: root
       <testing-self-service> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
       fatal: [testing-self-service]: FAILED! => {
           "changed": false,
           "cmd": [
               "/opt/redislabs/bin/rladmin",
               "status",
               "extra",
               "all"
           ],
           "delta": "0:00:10.869604",
           "end": "2020-03-17 15:50:14.486555",
           "invocation": {
               "module_args": {
                   "_raw_params": "/opt/redislabs/bin/rladmin status extra all",
                   "_uses_shell": false,
                   "argv": null,
                   "chdir": null,
                   "creates": null,
                   "executable": null,
                   "removes": null,
                   "stdin": null,
                   "stdin_add_newline": true,
                   "strip_empty_ends": true,
                   "warn": true
               }
           },
           "msg": "non-zero return code",
           "rc": 1,
           "start": "2020-03-17 15:50:03.616951",
           "stderr": "",
           "stderr_lines": [],
           "stdout": "error: cluster is not responding, please try again.",
           "stdout_lines": [
               "error: cluster is not responding, please try again."
           ]
       }

Using shell provisioner

$ kitchen converge
-----> Starting Test Kitchen (v2.3.4)
-----> Converging <default-rhel7>...
       Preparing files for transfer
       Preparing script
       No provisioner script file specified, skipping
       Transferring files to <default-rhel7>
       CLUSTER:
       OK. Cluster master: 1 (10.72.2.121)
       Cluster health: OK, [0, 0.0, 0.0]
       Downloading files from <default-rhel7>
       Finished converging <default-rhel7> (0m2.22s).