---
- hosts: all
gather_facts: no
tasks:
- name: check for server ssh
wait_for:
port: 22
host: "{{ item }}"
state: started
search_regex: SSH
delay: 5
timeout: 300
register: ssh_out
ignore_errors: true
with_items:
- 192.168.153.31
- 192.168.153.32
- debug: var=ssh_out.results
- lineinfile:
line: "{{item.state}}"
path: /home/bindu/playbooks/salman/log/ssh_log
create: yes
loop: "{{ ssh_out.results }}"
I am seeing error like "'PermissionError' object is not subscriptable".