[Use this tool from SolarWinds] (http://www.solarwinds.com/products/freetools/remote-execution-enabler-for-powershell.aspx)
[Use the Ansible provided PowerShell Script] (https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 )
powershell.exe -ExecutionPolicy Bypass -File ConfigureRemotingForAnsible.ps1 -CertValidityDays 3650 -Verbose
Install ansible
yum install epel-release
yum install ansible
yum install python2-winrm
We need python2-winrim
Option A
yum install python2-winrim
OR
Option B
pip install "pywinrm>=0.2.2"
mkdir ansible-workshop
cd ansible-workshop
mkdir {roles,inventory,host_vars,group_vars}
touch host_vars/<linux_host>
touch host_var/<windows_host>
touch group_vars/linux
touch group_vars/windows
touch group_vars/drupal
touch group_vars/iis
touch ansible.cfg
[defaults]
inventory = <FILLIN>/ansible-workshop/inventory
gathering = smart
roles_path = <FILLIN>/ansible-workshop/roles
remote_user = root
#private_key_file =
#vault_password_file =
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
[privilege_escalation]
[paramiko_connection]
[ssh_connection]
pipelining = True
scp_if_ssh = True
[persistent_connection]
connect_timeout = 30
connect_retries = 30
connect_interval = 1
[accelerate]
[selinux]
[colors]
[diff]
ansible_user: 'localAdminUser'
ansible_password: 'P455w0rd'
ansible_connection: 'winrm'
ansible_port: 5986
ansible_winrm_server_cert_validation: 'ignore'
ansible_user: ec2-user
ansible_ssh_private_key_file: /path/to/aws/pem/aws-personal.pem
---
- hosts: all
tasks:
- fail:
msg: "This is not a Windows system"
when: ansible_os_family != "Windows"
- name: "Install dotnet"
win_shell: c:\REPLACE_ME.EXE /quiet /norestart
register: dotnet_is_install
- name: "Show me dotnet installation result"
debug:
var: dotnet_is_install
List all avail features
Get-WindowsFeature
- win_file
- win_iis_webapppool
- win_iis_virtualdirectory
- win_iis_website
git init
git add *
git commit -m "first commit"
git remote add origin git@github.com:flyemsafe/ansible-excercise.git
git push -u origin master