diff --git a/misc/prepare-windows-agent b/misc/prepare-windows-agent new file mode 100644 index 0000000..8644675 --- /dev/null +++ b/misc/prepare-windows-agent @@ -0,0 +1,11 @@ +Ansible WindowsResumen: +1) Poner el Windows de Red Publica a Privada +2) winrm quickconfig -force +3) winrm set winrm/config/service '@{AllowUnencrypted="true"}' +4) winrm set winrm/config/auth '@{Basic="true"}' +5) Set-Item -Path WSMan:\localhost\Service\AllowUnencrypted -Value $true +6) Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $true +7) New-NetFirewallRule -Name "WinRM HTTP" -DisplayName "WinRM HTTP" -Enabled True -Direction Inbound -Protocol TCP -LocalPort 5985 -Action Allow + + + diff --git a/misc/windows-host b/misc/windows-host new file mode 100644 index 0000000..4c433d0 --- /dev/null +++ b/misc/windows-host @@ -0,0 +1,9 @@ +[windows] +win101 ansible_host=192.168.1.175 + +[windows:vars] +ansible_user=AnsibleNode +ansible_password=ansible +ansible_port=5985 +ansible_connection=winrm +ansible_winrm_server_cert_validation=ignore \ No newline at end of file diff --git a/training/windows.yml b/training/windows.yml new file mode 100644 index 0000000..dae65ac --- /dev/null +++ b/training/windows.yml @@ -0,0 +1,20 @@ +--- +- name: Prueba de conexión a Windows + hosts: windows + tasks: + - name: Hacer ping a máquina + ansible.windows.win_ping: + + - name: run the setup facts + ansible.windows.setup: + + - name: Copy a single file + ansible.windows.win_copy: + src: prueba.txt + dest: C:\Users\vboxuser\Desktop\escritorio.txt + + - name: Copy a single file where the source is on the remote host + ansible.windows.win_copy: + src: C:\Users\vboxuser\Desktop\escritorio.txt + dest: C:\Users\vboxuser\Desktop\escritorioSegundo.txt + remote_src: true \ No newline at end of file