This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
homeserver-ansible/tasks/ssh_port.yml

43 lines
978 B
YAML

- name: Use default credentials for ssh
set_fact:
ansible_user: "{{ admin_username }}"
- name: Attempt ssh connection
become: no
raw: "echo Pong!"
ignore_unreachable: true
changed_when: false
register: ssh_result_default
- name: Use fallback port for ssh
set_fact:
ansible_ssh_port: 22
when:
- ssh_result_default is unreachable
- name: Attempt ssh connection
become: no
raw: "echo Pong!"
ignore_unreachable: true
changed_when: false
register: ssh_result_port
when:
- ssh_result_default is unreachable
- name: Use fallback port and default Arch Linux ARM credentials for ssh
set_fact:
ansible_ssh_port: "22"
ansible_user: "alarm"
ansible_ssh_password: "alarm"
when:
- ssh_result_default is unreachable
- ssh_result_port is unreachable
- name: Attempt ssh connection
become: no
changed_when: false
raw: "echo Pong!"
when:
- ssh_result_default is unreachable
- ssh_result_port is unreachable