Difference between revisions of "Ansible"
Jump to navigation
Jump to search
(Created page with "# Presentations - https://www.cisco.com/c/dam/m/sr_rs/events/2019/cisco-connect/pdf/using_ansible_in_dc_automation_radenko_citakovic.pdf") |
|||
Line 1: | Line 1: | ||
+ | # Install and Use | ||
+ | ``` | ||
+ | sudo apt install ansible sshpass | ||
+ | ``` | ||
+ | |||
+ | inventory.txt | ||
+ | ``` | ||
+ | [Windows] | ||
+ | winhost.example.com | ||
+ | |||
+ | [Windows:vars] | ||
+ | ansible_user=<myuser> | ||
+ | ansible_password=<mypass> | ||
+ | ansible_connection=winrm | ||
+ | # ansible_port=5985 | ||
+ | # ansible_winrm_scheme=http | ||
+ | ansible_port=5986 | ||
+ | ansible_winrm_scheme=https | ||
+ | ansible_winrm_server_cert_validation: ignore | ||
+ | |||
+ | |||
+ | [Linux] | ||
+ | linuxhost.example.com | ||
+ | |||
+ | |||
+ | [Linux:vars] | ||
+ | ansible_user=<my user> | ||
+ | ansible_password=<my pass> | ||
+ | ansible_connection=ssh | ||
+ | ``` | ||
+ | https://www.vgemba.net/ansible/Ansible-WinRM-Workgroup/ | ||
+ | |||
+ | ``` | ||
+ | ansible 'Windows' --inventory-file inventory.txt -a "pwd" | ||
+ | ``` | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ``` | ||
+ | ansible myhost.example.com -a "pwd" --ask-pass | ||
+ | ``` | ||
+ | |||
# Presentations | # Presentations | ||
- https://www.cisco.com/c/dam/m/sr_rs/events/2019/cisco-connect/pdf/using_ansible_in_dc_automation_radenko_citakovic.pdf | - https://www.cisco.com/c/dam/m/sr_rs/events/2019/cisco-connect/pdf/using_ansible_in_dc_automation_radenko_citakovic.pdf | ||
+ | |||
+ | |||
+ | https://www.vgemba.net/ansible/Ansible-WinRM-Workgroup/ |
Revision as of 19:42, 1 July 2021
Install and Use
sudo apt install ansible sshpass
inventory.txt
[Windows] winhost.example.com [Windows:vars] ansible_user=<myuser> ansible_password=<mypass> ansible_connection=winrm # ansible_port=5985 # ansible_winrm_scheme=http ansible_port=5986 ansible_winrm_scheme=https ansible_winrm_server_cert_validation: ignore [Linux] linuxhost.example.com [Linux:vars] ansible_user=<my user> ansible_password=<my pass> ansible_connection=ssh
https://www.vgemba.net/ansible/Ansible-WinRM-Workgroup/
ansible 'Windows' --inventory-file inventory.txt -a "pwd"
ansible myhost.example.com -a "pwd" --ask-pass