Hi,

I am new to ansible and trying to test a playbook to check availability of 
a port number. If one found then use it, if not then go to the next one. 
Following is my playbook code,

  tasks:
  - name: check port number
    become: yes
    become_user: root
    command: /bin/netstat -anp | grep "{{ item }}"
    register: result
    until: result.stdout.split()|length > 0
    with_sequence: start=5432 end=5500

Unfortunately it did not work and get me the following error.

TASK [check port number] 
*******************************************************
An exception occurred during task execution. To see the full traceback, use 
-vvv. The error was: TypeError: unsupported operand type(s) for +: 
'NoneType' and 'int'
fatal: [pmr71dev402.auiag.corp]: FAILED! => {"failed": true, "msg": 
"Unexpected failure during module execution.", "stdout": ""}

Could someone please help and advise?

Also, if there is a better way to do this please feel free to advise me too.

Regards,
Andrew

-- 
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/6fd63883-5460-4f5a-bd41-2f842be72b48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to