ansible & automation - derek-hash/SYS-265-02 GitHub Wiki
Update the system packages:
sudo apt update Install software-properties-common:
sudo apt install software-properties-common Add the Ansible PPA repository:
sudo add-apt-repository --yes --update ppa:ansible/ansible Install Ansible:
sudo apt install ansible Verify the installation:
ansible --version
nano inventory.txt
add the following to the inventory file
[windows] mgmt01
[windows:vars] ansible_connection=ssh
ansible_user=deployer
ansible_ssh_pass=your_deployer_password
ansible_shell_type=powershell
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
#Now you have to edit the win_ping file.
nano win_ping.yml
- hosts: windows
gather_facts: no
tasks:
- name: Test connectivity to Windows host win_ping:
ansible-playbook win_ping.yml