Fantastic. So the box is running acme sbc. Aim to achieve the following via AWX / Ansible: ***************# show platform cpu-load summary <------- the command to run Total load: 11% CPU#00 14% CPU#01 8%
Load average: 2.86 3.00 3.00 2/281 7385 Playbook contents : --- - name: Check CPU Load hosts: all connection: local gather_facts: yes tasks: - name: Get CPU Load expect: command: show platform cpu-load summary responses: cpu Json returned: { "_ansible_parsed": true, "exception": " File \"/tmp/ansible_nV8SnW/ansible_modlib.zip/ansible/module_utils/basic.py\", line 2056, in _check_argument_types\n param[k] = type_checker(value)\n File \"/tmp/ansible_nV8SnW/ansible_modlib.zip/ansible/module_utils/basic.py\", line 1907, in _check_type_dict\n raise TypeError(\"dictionary requested, could not parse JSON or key=value\")\n", "_ansible_no_log": false, "changed": false, "invocation": { "module_args": { "command": "show platform cpu-load summary", "responses": "cpu", "timeout": 30, "echo": false } }, "msg": "argument responses is of type <type 'str'> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value" } ############################ To be honest I am unsure if A - I am using the expect module correctly or B - Is the command module even the right thing here? These are non standard / custom devices. No shell to execute commands on, raw,shell and command fail to execute the "show platform cpu-load summary" On Wednesday, August 29, 2018 at 11:49:18 AM UTC+2, Kai Stian Olstad wrote: > > On 29.08.2018 11:41, julian.mit...@gmail.com <javascript:> wrote: > > I tried executing off the expect module but cannot seem to get it > > right? > > If you show the output of the command when you run them manually and the > expect you have tried, I can always help getting the expect up and > running. > > -- > Kai Stian Olstad > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7a721fb6-9a74-498e-82cf-25345efc77f0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.