On Saturday, 1 December 2018 03:11:52 CET Saravanan wrote:
> Thanks for your reply Kai.
> I am using the below task using command module to get the uptime value of 
> JBOSS EAP server instance. However still I am receiving error as mentioned 
> below.
> 
> - name: Check the JBOSS Server Uptime Domain mode
>   command: "{{ CLI_SCRIPT }} --connect controller={{ item.hostname }}:{{ 
> item.port }} --user={{ jbossuser }} --password={{ jbosspass }} /host={{ 
> item.host }}-{{ item.server 
> }}/core-service=platform-mbean/type=runtime:read-attribute(name=uptime)| awk 
> '/result/ { print $3 }'"
>   register: uptime
>   delegate_to: remoteserver
>   ignore_errors: yes

Command module doesn't support pipe or redirect only shell module does that.
So just replace command: with shell: and it this should work.


> I believe we can use Ansible regex, to capture this value.

To my knowledge (or lack there of) this is actually cumbersome to achieve in 
Ansible, just using shell module and add awk is way easier.



-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/16977342.Q0VkCbGrXk%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to