Ansible-ssh

From UVOO Tech Wiki
Jump to navigation Jump to search

https://stackoverflow.com/questions/68055804/changing-ssh-port-with-ansible-playbook

---
- hosts: windows
  vars:
    ansible_user: "administrator"
    ansible_password: "mypassword"
    ansible_port: 22
    ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
    ansible_ssh_retries: 3
    ansible_shell_type: powershell
    ansible_become_method: runas
    ansible_become_user: "{{ ansible_user }}"

  tasks:
    - name: test powershell
      win_shell: |
                get-host
      register: result_get_host

    - name: display result_get_host
      debug:

-https://iamroot.it/2021/10/18/using-ansible-to-connect-to-windows-using-ssh-instead-of-winrm/