2023-04-14 10:31:09 +00:00
|
|
|
- hosts: custom
|
|
|
|
gather_facts: no
|
|
|
|
vars:
|
|
|
|
ansible_connection: local
|
2023-11-15 06:59:40 +00:00
|
|
|
ansible_shell_type: sh
|
2023-08-03 06:09:13 +00:00
|
|
|
ansible_become: false
|
2023-04-14 10:31:09 +00:00
|
|
|
|
|
|
|
tasks:
|
2023-06-15 10:33:05 +00:00
|
|
|
- name: Verify account (paramiko)
|
2023-04-14 10:31:09 +00:00
|
|
|
ssh_ping:
|
|
|
|
login_host: "{{ jms_asset.address }}"
|
2023-11-15 06:59:40 +00:00
|
|
|
login_port: "{{ jms_asset.protocols | selectattr('name', 'equalto', 'ssh') | map(attribute='port') | first }}"
|
2023-04-14 10:31:09 +00:00
|
|
|
login_user: "{{ account.username }}"
|
|
|
|
login_password: "{{ account.secret }}"
|
2023-05-22 09:29:17 +00:00
|
|
|
login_secret_type: "{{ account.secret_type }}"
|
|
|
|
login_private_key_path: "{{ account.private_key_path }}"
|
2023-10-09 06:35:21 +00:00
|
|
|
become: "{{ account.become.ansible_become | default(False) }}"
|
|
|
|
become_method: "{{ account.become.ansible_become_method | default('su') }}"
|
|
|
|
become_user: "{{ account.become.ansible_user | default('') }}"
|
|
|
|
become_password: "{{ account.become.ansible_password | default('') }}"
|
|
|
|
become_private_key_path: "{{ account.become.ansible_ssh_private_key_file | default(None) }}"
|