This file was generated by Ansigenome. Do not edit this file directly but instead have a look at the files in the ./meta/ directory.
Goal of this project is to launch ansible script using pywinrm. A VagrantFile is downloading a windows 2012 server VM that will be hosted on VirtualBox. Then we are launching Ansible script in order to set up this VM.
###Requirements
On Ubuntu, where VirtualBox and Vagrant are installed, do not forge to do the following : sudo pip install https://github.com/diyan/pywinrm/archive/df049454a9309280866e0156805ccda12d71c93a.zip --upgrade
It is working with the following version :
#Os is an Ubuntu 12
python -V #Python 2.7.3 pip -V #pip 1.4.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
VBoxManage --version #4.3.28r100309
vagrant --version #Vagrant 2.3.1.0
vagrant plugin list #winrm (1.1.3) #vagrant-login (1.0.1, system) #vagrant-share (1.1.0, system)
ansible --version #ansible 1.7.2
Ansible 2.5.0 is required on order to have win_copy working on Windows 7 and Windows Server 2016
Check winrm in target host
winrm id
winrm get winrm/config
For oler version od Windows, please do
Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 5000
Set-Item WSMan:\localhost\Plugin\Microsoft.PowerShell\Quotas\MaxMemoryPerShellMB 5000
Restart-Service winrm
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
On the windows VM :
Try :
powershell -File upgrade_to_ps3.ps1
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
cinst powershell
choco install powershell
choco upgrade powershell
powershell -File ConfigureRemotingForAnsible.ps1
On the windows VM : Install PowerShell Configure remoting Disable password
More information about alban.andrieu.windows
can be found in the
TODO official alban.andrieu.windows documentation.
List of default variables available in the inventory:
windows_enabled: yes # Enable module
#ansible_ssh_user: vagrant
#ansible_ssh_pass: vagrant
#target port
#ansible_ssh_port: 5986
#local port
#ansible_ssh_port: 55985
ansible_connection: winrm
Run the following command :
ansible-playbook -i hosts -c local -v windows.yml -vvvv --ask-sudo-pass | tee setup.log
$ ansible-galaxy install alban.andrieu.windows
$ vagrant up
The issue tracker is the preferred channel for bug reports, features requests and submitting pull requests.
For pull requests, editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at http://editorconfig.org.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
roles/alban_andrieu_windows
role was written by:
- License: GPLv3
Are welcome!
This role is part of the Nabla project. README generated by Ansigenome.
Alban Andrieu