Skip to content

Commit

Permalink
Add connect_linux.yml example
Browse files Browse the repository at this point in the history
  • Loading branch information
myllynen committed Feb 4, 2025
1 parent 4a20008 commit 016cce0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions connect_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
- name: Linux connectivity test
hosts: all
become: false
gather_facts: false
tasks:
- name: Check host reachable
wait_for:
host: "{{ inventory_hostname }}"
port: 22
search_regex: OpenSSH
timeout: 10
delegate_to: localhost

- name: Check host access
ping:

- name: Check user privileges
become: true
command: /usr/bin/whoami
register: whoami_output
failed_when: whoami_output.stdout != 'root'
changed_when: false

0 comments on commit 016cce0

Please sign in to comment.