diff --git a/ansible/README.md b/ansible/README.md index 9ef17d0ea..a15a7873b 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -5,8 +5,9 @@ ## Getting started -1. Install Ansible 2.2.0 or newer: `pip install ansible`. If you use brew, then - `brew install python2 ansible`, and then run +1. Follow the [instructions to install the latest version of Ansible][ansible-install]. + * In most cases, using pip: `pip install ansible`. + * If you use brew, then `brew install python2 ansible`, and then run `export PYTHONPATH=$(pip2 show pyyaml | grep Location | awk '{print $2}') ` before you use `ansible-playbook`. 2. Read this document. @@ -16,16 +17,31 @@ ## Getting things done Most of your work will probably include editing `inventory.yml`, followed by -running one (or multiple) of below playbooks. If you're adding a new host, -limiting ansible to just running on that host is probably quicker: +running one (or multiple) of below playbooks. + +See the [manual setup instructions](../doc/non-ansible-configuration-notes.md) +for how to prepare both the control and target machines to run the commands +below. To ensure that the secrets are in place and test the connection to a +host use: + +```console +$ ansible test-digitalocean-debian8-x64-1 -m ping -vvvv +## Or, for Windows hosts: +$ ansible test-rackspace-win2008r2-x64-1 -m win_ping -vvvv +``` + +If you're adding a new host, limiting Ansible to just running on that host is +probably quicker. In fact, you most likely want to use `--limit` for everything +when you just need to edit a few set of hosts: ```console $ ansible-playbook playbooks/jenkins/worker/create.yml \ - --limit "test-digitalocean-debian8-x64-1" + --limit "test-digitalocean-debian8-x64-1" -vv ``` -..in fact, you most likely want to use `--limit` for everything when you just -need to edit a few set of hosts. +If you only want to run a specific set of steps, you can use `--step`. This is +useful when developing playbooks and when you want to be sure that only a few +steps are executed, to avoid disrupting the machines. These playbooks are available to you: @@ -194,5 +210,6 @@ Unsorted stuff of things we need to do/think about - [ ] github-bot: automate list of whitelisted Jenkins worker IPs with python +[ansible-install]: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html [callback]: plugins/inventory/nodejs_yaml.py [github-bot]: https://github.com/nodejs/github-bot diff --git a/ansible/inventory.yml b/ansible/inventory.yml index 5c2ae7cb5..28936255a 100644 --- a/ansible/inventory.yml +++ b/ansible/inventory.yml @@ -70,17 +70,6 @@ hosts: - azure: msft-ubuntu1404-x64-1: {ip: node-msft-cross-compiler-1.cloudapp.net} - win10-x64-1: {ip: 40.114.4.213, port: 55646} - win10-x64-2: {ip: 40.76.31.157, port: 61279} - win10-x64-3: {ip: 40.76.25.231, port: 60033} - win10-x64-4: {ip: 40.76.23.22, port: 58919} - win10-x64-5: {ip: 40.76.19.120, port: 60486} - win2008r2-x64-1: {ip: 104.209.213.11, port: 55511} - win2008r2-x64-2: {ip: 104.209.209.74, port: 55516} - win2008r2-x64-3: {ip: 104.209.215.1, port: 54886} - win2012r2-x64-1: {ip: 104.209.213.170, port: 54633} - win2012r2-x64-2: {ip: 104.209.212.27, port: 61718} - win2012r2-x64-3: {ip: 104.209.210.218, port: 52109} - digitalocean: centos5-x86-1: {ip: 192.241.250.186} @@ -166,24 +155,6 @@ hosts: ubuntu1204-x64-1: {ip: 119.9.51.210} ubuntu1604-x64-1: {ip: 119.9.51.176} ubuntu1604-x64-2: {ip: 104.130.124.194} - win2008r2-x64-1: {ip: 104.130.225.148} - win2008r2-x64-2: {ip: 23.253.254.31} - win2008r2-x64-3: {ip: 104.130.8.178} - win2008r2-x64-4: {ip: 104.239.156.73} - win2008r2-x64-5: {ip: 104.239.231.190} - win2008r2-x64-6: {ip: 23.253.107.98} - win2012r2-x64-1: {ip: 104.130.175.153} - win2012r2-x64-2: {ip: 23.253.249.139} - win2012r2-x64-3: {ip: 162.242.241.50} - win2012r2-x64-4: {ip: 67.192.246.240} - win2012r2-x64-5: {ip: 104.239.174.16} - win2012r2-x64-6: {ip: 23.253.234.112} - win2012r2-x64-7: {ip: 162.242.247.5} - win2012r2-x64-8: {ip: 104.239.151.28} - win2012r2-x64-9: {ip: 104.239.231.87} - win2012r2-x64-10: {ip: 162.242.156.145} - win2012r2-x64-11: {ip: 162.242.235.179} - win2012r2-x64-12: {ip: 104.239.150.105} - requireio: andineck-debian9-armv6l_pi1p-1: {ip: 192.168.2.42, user: pi} diff --git a/ansible/playbooks/jenkins/worker/create-windows.yml b/ansible/playbooks/jenkins/worker/create-windows.yml new file mode 100644 index 000000000..7d4f89c72 --- /dev/null +++ b/ansible/playbooks/jenkins/worker/create-windows.yml @@ -0,0 +1,31 @@ +--- + +# +# set up a jenkins worker -- muy bueno! +# + +- hosts: + - "*-win*" + + roles: + - bootstrap + - package-upgrade + - visual-studio + - baselayout-windows + - jenkins-worker-windows + + pre_tasks: + - name: check if secret is properly set + fail: + failed_when: not secret + - name: check if the Visual Studio version to install is properly set + when: os|startswith("win") + fail: + failed_when: not vs + + post_tasks: + - name: reboot Windows machines + when: os|startswith("win") + win_reboot: + + environment: '{{remote_env}}' diff --git a/ansible/playbooks/jenkins/worker/create.yml b/ansible/playbooks/jenkins/worker/create.yml index befeb27c1..89e2c1cf8 100644 --- a/ansible/playbooks/jenkins/worker/create.yml +++ b/ansible/playbooks/jenkins/worker/create.yml @@ -11,6 +11,7 @@ - infra-softlayer-ubuntu1404-x64-2 - "!test-joyent-freebsd10-x64-2" - "!test-rackspace-freebsd10-x64-1" + - "!*-win*" roles: - bootstrap diff --git a/ansible/plugins/inventory/nodejs_yaml.py b/ansible/plugins/inventory/nodejs_yaml.py index f52540ed6..eb5aff917 100755 --- a/ansible/plugins/inventory/nodejs_yaml.py +++ b/ansible/plugins/inventory/nodejs_yaml.py @@ -105,11 +105,7 @@ def main(): hostname = '{}-{}{}{}'.format(host_type, provider_name, delimiter, host) - # no point in adding windows servers for now - if 'win' in hostname: - continue - else: - export[host_type]['hosts'].append(hostname) + export[host_type]['hosts'].append(hostname) c = {} @@ -135,8 +131,8 @@ def main(): if 'alias' in metadata: c.update({'alias': metadata['alias']}) - if 'win' in hostname: - c.update({'is_win': True}) + if 'vs' in metadata: + c.update({'vs': metadata['vs']}) # add specific options from config for option in ifilter(lambda s: s.startswith('hosts:'), diff --git a/ansible/roles/baselayout-windows/tasks/main.yml b/ansible/roles/baselayout-windows/tasks/main.yml new file mode 100644 index 000000000..d678cc525 --- /dev/null +++ b/ansible/roles/baselayout-windows/tasks/main.yml @@ -0,0 +1,69 @@ +--- + +# +# Install Node build dependencies and other required software +# + +- name: install NetWide Assembler + win_chocolatey: name=nasm + +- name: install Python 2 + win_chocolatey: name=python2 + +- block: + - name: install Git + win_chocolatey: + name: git + params: '/GitAndUnixToolsOnPath' + - name: enable long paths in Git + win_command: 'git config --global core.longpaths true' + +# Necessary for junit output in Jenkins jobs +- name: install tap2junit + win_command: 'pip2 install tap2junit' + +# Necessary for the libuv test job +- block: + - name: check if GYP is already cloned + win_stat: path='C:\gyp' + register: gyp_stat + - name: clone GYP repository + win_command: 'git clone https://chromium.googlesource.com/external/gyp C:\gyp' + when: not gyp_stat.stat.exists + - name: update GYP repository + win_command: 'git pull' + args: { chdir: 'C:\gyp' } + when: gyp_stat.stat.exists + +# Necessary for releases of older versions of Node +- block: + - name: create node-icu directory + win_file: path='C:\\node-icu' state=directory + - name: download ICU2C 54 zip + win_get_url: + url: 'http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.zip' + dest: 'C:\node-icu\icu4c-54_1-src.zip' + force: no + - name: download ICU2C 55 zip + win_get_url: + url: 'http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-src.zip' + dest: 'C:\node-icu\icu4c-55_1-src.zip' + force: no + - name: download ICU2C 56 zip + win_get_url: + url: 'http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.zip' + dest: 'C:\node-icu\icu4c-56_1-src.zip' + force: no + +# Necessary for compressing the Node package +- name: install 7Zip + win_chocolatey: name=7zip + +# Utilities +- block: + - name: install Sysinternals Suite + win_chocolatey: name=sysinternals + - name: install Google Chrome + win_chocolatey: name=googlechrome + - name: install Notepad++ + win_chocolatey: name=notepadplusplus diff --git a/ansible/roles/baselayout/tasks/main.yml b/ansible/roles/baselayout/tasks/main.yml index 87b185fca..728c4e786 100644 --- a/ansible/roles/baselayout/tasks/main.yml +++ b/ansible/roles/baselayout/tasks/main.yml @@ -30,7 +30,6 @@ shell: coreadm -i /home/iojs/cores/core.%f.%p -e process -d global - name: disable sftp - when: not os|startswith("win") notify: restart sshd lineinfile: state=absent dest="{{ ssh_config }}" regexp=^Subsystem(\s+)sftp diff --git a/ansible/roles/bootstrap/tasks/partials/win.yml b/ansible/roles/bootstrap/tasks/partials/win.yml new file mode 100644 index 000000000..6ddb77fe1 --- /dev/null +++ b/ansible/roles/bootstrap/tasks/partials/win.yml @@ -0,0 +1,28 @@ +--- + +# +# Windows bootstrap +# + +- name: create TEMP directory + win_file: path='C:\TEMP' state=directory + +- block: + - name: set automatic logon user name + win_regedit: + path: "{{ autologon_regpath }}" + name: DefaultUsername + data: "{{ ansible_ssh_user }}" + type: string + - name: set automatic logon password + win_regedit: + path: "{{ autologon_regpath }}" + name: DefaultPassword + data: "{{ ansible_ssh_pass }}" + type: string + - name: enable automatic logon + win_regedit: + path: "{{ autologon_regpath }}" + name: AutoAdminLogon + data: 1 + type: string diff --git a/ansible/roles/bootstrap/vars/main.yml b/ansible/roles/bootstrap/vars/main.yml index b366298b7..a33d150fc 100644 --- a/ansible/roles/bootstrap/vars/main.yml +++ b/ansible/roles/bootstrap/vars/main.yml @@ -1,3 +1,5 @@ raspberry_pi: { apt_proxy: 'http://192.168.2.100:3142', } + +autologon_regpath: 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml index 24e944b62..1a28853e8 100644 --- a/ansible/roles/docker/tasks/main.yml +++ b/ansible/roles/docker/tasks/main.yml @@ -12,7 +12,6 @@ name: "{{ inventory_hostname|replace('_', '-') }}" - name: disable sftp - when: not os|startswith("win") notify: restart sshd lineinfile: state: absent diff --git a/setup/windows/resources/Jenkins-Shortcuts.ps1 b/ansible/roles/jenkins-worker-windows/files/Jenkins-Shortcuts.ps1 similarity index 100% rename from setup/windows/resources/Jenkins-Shortcuts.ps1 rename to ansible/roles/jenkins-worker-windows/files/Jenkins-Shortcuts.ps1 diff --git a/ansible/roles/jenkins-worker-windows/tasks/main.yml b/ansible/roles/jenkins-worker-windows/tasks/main.yml new file mode 100644 index 000000000..fae778bb9 --- /dev/null +++ b/ansible/roles/jenkins-worker-windows/tasks/main.yml @@ -0,0 +1,22 @@ +--- + +# +# Install the Jenkins worker +# + +- name: install Java 8 + win_chocolatey: name=jdk8 + +- name: download Jenkins icon + win_get_url: + url: 'http://mirrors.jenkins-ci.org/art/jenkins-logo/favicon.ico' + dest: 'C:\jenkins.ico' + force: no + +- name: create jenkins.bat + win_template: + src: '../templates/jenkins.bat' + dest: 'C:\jenkins.bat' + +- name: create Jenkins shortcuts + script: '../files/Jenkins-Shortcuts.ps1' diff --git a/ansible/roles/jenkins-worker-windows/templates/jenkins.bat b/ansible/roles/jenkins-worker-windows/templates/jenkins.bat new file mode 100644 index 000000000..5243634a6 --- /dev/null +++ b/ansible/roles/jenkins-worker-windows/templates/jenkins.bat @@ -0,0 +1,7 @@ +C: +cd \ +:start +curl -L {{ jenkins_worker_jar }} -o {{ agent_path }} +java -Dhudson.remoting.Launcher.pingIntervalSec=10 -jar {{ agent_path }} -jnlpUrl {{ jenkins_url }}/computer/{{ inventory_hostname }}/slave-agent.jnlp -secret {{ secret }} +echo Restarting Jenkins... +goto start diff --git a/ansible/roles/jenkins-worker-windows/vars/main.yml b/ansible/roles/jenkins-worker-windows/vars/main.yml new file mode 100644 index 000000000..c22a9c3ad --- /dev/null +++ b/ansible/roles/jenkins-worker-windows/vars/main.yml @@ -0,0 +1,2 @@ +--- +agent_path: 'C:\jenkins_agent.jar' diff --git a/ansible/roles/package-upgrade/tasks/partials/chocolatey.yml b/ansible/roles/package-upgrade/tasks/partials/chocolatey.yml new file mode 100644 index 000000000..583f2d60f --- /dev/null +++ b/ansible/roles/package-upgrade/tasks/partials/chocolatey.yml @@ -0,0 +1,32 @@ +--- + +# +# Updates Windows +# + +- block: + - name: reboot machine to ensure no updates are pending + win_reboot: + - name: wait for Jenkins to start if already installed + win_shell: 'Start-Sleep -Seconds 10' + - name: stop Jenkins after reboot + win_shell: 'Get-WmiObject Win32_Process -Filter "(Name = ''cmd.exe'') AND (CommandLine LIKE ''%jenkins.bat%'')" | % {$_.Terminate()}' + +- name: download and install Windows updates + win_updates: + register: update_result + +- when: update_result.reboot_required + block: + - name: reboot machine if necessary + win_reboot: + reboot_timeout: 3600 + - name: wait for Jenkins to start if already installed + win_shell: 'Start-Sleep -Seconds 10' + - name: stop Jenkins after reboot + win_shell: 'Get-WmiObject Win32_Process -Filter "(Name = ''cmd.exe'') AND (CommandLine LIKE ''%jenkins.bat%'')" | % {$_.Terminate()}' + +- name: upgrade installed packages + win_chocolatey: + name: all + state: latest diff --git a/ansible/roles/package-upgrade/vars/main.yml b/ansible/roles/package-upgrade/vars/main.yml index 32dbee3ad..bce8fa728 100644 --- a/ansible/roles/package-upgrade/vars/main.yml +++ b/ansible/roles/package-upgrade/vars/main.yml @@ -10,6 +10,7 @@ 'dnf': 'fedora', 'pkg': 'freebsd', 'pkgin': 'smartos', + 'chocolatey': 'win', 'brew': 'macos' } diff --git a/ansible/roles/visual-studio/tasks/main.yml b/ansible/roles/visual-studio/tasks/main.yml new file mode 100644 index 000000000..3f65960b1 --- /dev/null +++ b/ansible/roles/visual-studio/tasks/main.yml @@ -0,0 +1,29 @@ +--- + +# +# Install Visual Studio +# + +- when: vs == 2013 + block: + # TODO: Ensure no other versions are installed + - name: install Visual Studio 2013 + include_tasks: "partials/vs2013.yml" + +- when: vs == 2015 + block: + # TODO: Ensure no other versions are installed + - name: install Visual Studio 2015 + include_tasks: "partials/vs2015.yml" + +- when: vs == 'vcbt2015' + block: + # TODO: Ensure no other versions are installed + - name: install Visual C++ Build Tools 2015 + include_tasks: "partials/vcbt2015.yml" + +- when: vs == 2017 + block: + # TODO: Ensure no other versions are installed + - name: install Visual Studio 2017 + include_tasks: "partials/vs2017.yml" diff --git a/ansible/roles/visual-studio/tasks/partials/vcbt2015.yml b/ansible/roles/visual-studio/tasks/partials/vcbt2015.yml new file mode 100644 index 000000000..b55f90a94 --- /dev/null +++ b/ansible/roles/visual-studio/tasks/partials/vcbt2015.yml @@ -0,0 +1,28 @@ +--- + +# +# Install Visual C++ Build Tools 2015 +# + +- name: download .NET Framework + win_get_url: + url: 'http://go.microsoft.com/fwlink/?LinkId=671743' + dest: 'C:\TEMP\netfw.exe' + force: no + +- name: install .NET Framework + win_command: 'C:\TEMP\netfw.exe /q /norestart + /log C:\TEMP\netfw_install_log.txt' + +- name: download Visual C++ Build Tools 2015 + win_get_url: + url: 'https://go.microsoft.com/fwlink/?LinkId=691126' + dest: 'C:\TEMP\vcbt2015.exe' + force: no + +- name: install Visual C++ Build Tools 2015 + win_command: 'C:\TEMP\vcbt2015.exe /Silent /NoRestart /Full + /Log C:\TEMP\vsbt2015_install_log.txt' + +- name: install WiX Toolset + import_tasks: 'wixtoolset.yml' diff --git a/ansible/roles/visual-studio/tasks/partials/vs2013.yml b/ansible/roles/visual-studio/tasks/partials/vs2013.yml new file mode 100644 index 000000000..fb27c81d6 --- /dev/null +++ b/ansible/roles/visual-studio/tasks/partials/vs2013.yml @@ -0,0 +1,18 @@ +--- + +# +# Install Visual Studio 2013 +# + + +- name: download Visual Studio Community 2013 + win_get_url: + url: 'https://go.microsoft.com/fwlink/?LinkId=532495' + dest: 'C:\TEMP\vs2013_community.exe' + +- name: install Visual Studio Community 2013 + win_command: 'C:\TEMP\vs2013_community.exe /Silent /NoRestart + /Log C:\TEMP\vs2013_install_log.txt' + +- name: install WiX Toolset + import_tasks: 'wixtoolset.yml' diff --git a/ansible/roles/visual-studio/tasks/partials/vs2015.yml b/ansible/roles/visual-studio/tasks/partials/vs2015.yml new file mode 100644 index 000000000..7a1159357 --- /dev/null +++ b/ansible/roles/visual-studio/tasks/partials/vs2015.yml @@ -0,0 +1,19 @@ +--- + +# +# Install Visual Studio 2015 +# + +- name: download Visual Studio Community 2015 + win_get_url: + url: 'https://go.microsoft.com/fwlink/?LinkId=532606' + dest: 'C:\TEMP\vs2015_community.exe' + force: no + +- name: install Visual Studio Community 2015 + win_command: 'C:\TEMP\vs2015_community.exe /Silent /NoRestart + /InstallSelectableItems NativeLanguageSupport_Group + /Log C:\TEMP\vs2015_install_log.txt' + +- name: install WiX Toolset + import_tasks: 'wixtoolset.yml' diff --git a/ansible/roles/visual-studio/tasks/partials/vs2017.yml b/ansible/roles/visual-studio/tasks/partials/vs2017.yml new file mode 100644 index 000000000..d9fe275ec --- /dev/null +++ b/ansible/roles/visual-studio/tasks/partials/vs2017.yml @@ -0,0 +1,26 @@ +--- + +# +# Install Visual Studio 2017 +# + + +- name: install Visual Studio Community 2017 + win_chocolatey: name=visualstudio2017community + +- name: install Visual Studio Community 2017 Native Desktop Workload + win_chocolatey: name=visualstudio2017-workload-nativedesktop + +- name: install WiX Toolset + import_tasks: 'wixtoolset.yml' + +# Note: https://chocolatey.org/docs/helpers-install-chocolatey-vsix-package exists, but +# can't be used with VS2017 yet: https://github.com/chocolatey/choco/issues/1201 + +- name: download WiX Toolset Visual Studio Extension + win_get_url: + url: 'https://github.com/wixtoolset/VisualStudioExtension/releases/download/v0.9.21.62588/Votive2017.vsix' + dest: 'C:\TEMP\Votive2017.vsix' + +- name: install WiX Toolset Visual Studio Extension + win_shell: '& "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VSIXInstaller.exe" /quiet C:\TEMP\Votive2017.vsix' diff --git a/ansible/roles/visual-studio/tasks/partials/wixtoolset.yml b/ansible/roles/visual-studio/tasks/partials/wixtoolset.yml new file mode 100644 index 000000000..c741186e8 --- /dev/null +++ b/ansible/roles/visual-studio/tasks/partials/wixtoolset.yml @@ -0,0 +1,12 @@ +--- + +# +# Install WiX Toolset +# + +# https://github.com/wixtoolset/issues/issues/5661 +- name: install Dot Net 3.5 + win_chocolatey: name=dotnet3.5 + +- name: install WiX Toolset + win_chocolatey: name=wixtoolset diff --git a/doc/non-ansible-configuration-notes.md b/doc/non-ansible-configuration-notes.md index e451f0b33..49808cac1 100644 --- a/doc/non-ansible-configuration-notes.md +++ b/doc/non-ansible-configuration-notes.md @@ -4,8 +4,6 @@ There are a number of infrastructure setup tasks that are not currently automate ## Windows (Azure/Rackspace) -Currently the Windows configuration is [stand-alone][] and not part of the [newer Ansible configuration][], however it is up to date. - In order to get Windows machines to a state where Ansible can be run against them, some manual steps need to be taken so that Ansible can connect. Machines should have: @@ -18,13 +16,12 @@ To use Ansible for Windows, PowerShell access should be enabled as described in Install the `pywinrm` pip module. -Create a file `host_vars/node-win10-1.cloudapp.net` (`host_vars` in the same directory as `ansible-inventory`) +Create a file `host_vars/node-win10-1.cloudapp.net` (`host_vars` in the same directory as `inventory.yml`) for each host and change the variables as necessary: ```yaml --- -server_id: node-msft-win10-1 -server_secret: SECRET +secret: SECRET ansible_user: USERNAME ansible_password: PASSWORD ansible_port: 5986 diff --git a/setup/ansible-inventory b/setup/ansible-inventory index c71fc1414..dbd1f7e20 100644 --- a/setup/ansible-inventory +++ b/setup/ansible-inventory @@ -45,40 +45,3 @@ iojs-build-centos5 [iojs-aix61] test-ibm-aix61-ppc64-1:18822 - -[node-windows] -node-win10-x64-1.cloudapp.net -node-win10-x64-2.cloudapp.net -node-win10-x64-3.cloudapp.net -node-win10-x64-4.cloudapp.net -node-win10-x64-5.cloudapp.net -node-win2008r2-x64-1.cloudapp.net -node-win2008r2-x64-2.cloudapp.net -node-win2008r2-x64-3.cloudapp.net -node-win2012r2-x64-1.cloudapp.net -node-win2012r2-x64-2.cloudapp.net -node-win2012r2-x64-3.cloudapp.net -node-win2016-15213.cloudapp.net -node-win2016-26485.cloudapp.net -node-win2016-39067.cloudapp.net -node-win2016-41016.cloudapp.net -node-win2016-51654.cloudapp.net -node-win2016-62910.cloudapp.net -104.130.225.148 -23.253.254.31 -104.130.8.178 -104.239.156.73 -104.239.231.190 -23.253.107.98 -104.130.175.153 -23.253.249.139 -162.242.241.50 -67.192.246.240 -104.239.174.16 -23.253.234.112 -162.242.247.5 -104.130.124.222 -104.239.231.87 -162.242.156.145 -162.242.235.179 -104.239.150.105 diff --git a/setup/windows/README.md b/setup/windows/README.md deleted file mode 100644 index e3ff77bee..000000000 --- a/setup/windows/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Node.js Build Windows Setup for Jenkins Test Machines - -See the [manual setup instructions](../../doc/non-ansible-configuration-notes.md) for how to prepare both the control and target machines to run the commands below. - -To test the connection to the hosts, run: - -```text -$ ansible node-windows -i ../ansible-inventory -m win_ping -vvvv -``` - -To run the Ansible playbook to setup the machines run below command depending on the version of Visual Studio that needs to be installed. -Below command setup the machine with VS2015. - -```text -$ ansible-playbook -i ../ansible-inventory vs2015-ansible-playbook.yaml -vv -``` - -The servers should logon automatically at boot and start the Jenkins slave. - -The release servers need to have the WiX Toolset and 7-Zip installed and in the path (not part of this script). diff --git a/setup/windows/common-ansible-playbook.yaml b/setup/windows/common-ansible-playbook.yaml deleted file mode 100644 index c18f7641b..000000000 --- a/setup/windows/common-ansible-playbook.yaml +++ /dev/null @@ -1,118 +0,0 @@ ---- - -- name: Create C:\TEMP directory - win_file: path='C:\TEMP' state=directory - -- name: NetWide Assembler - win_chocolatey: - name: nasm - state: latest - -- name: Python | Download Python 2 MSI - win_get_url: - url: 'https://www.python.org/ftp/python/2.7.10/python-2.7.10.amd64.msi' - dest: 'C:\TEMP\python.msi' - tags: [download, python] - -- name: Python | Install Python 2 - # ADDLOCAL=ALL means install all features, including appending python to the path - raw: 'msiexec /i C:\TEMP\python.msi /qn ADDLOCAL=ALL - /l*v C:\TEMP\python_install_log.txt' - tags: [install, python] - -- name: Java | Download Java 8 - win_get_url: - url: 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=109708' - dest: 'C:\TEMP\java.exe' - tags: [download, java] - -- name: Java | Install Java 8 - raw: 'C:\TEMP\java.exe /s SPONSORS=0 /l*v C:\TEMP\java_install_log.txt' - tags: [install, java] - -- name: Git | Download Git - win_get_url: - url: 'https://github.com/git-for-windows/git/releases/download/v2.14.1.windows.1/Git-2.14.1-64-bit.exe' - dest: 'C:\TEMP\git.exe' - tags: [download, git] - -- name: Git | Stat Downloaded Git - win_stat: - path: 'C:\TEMP\git.exe' - get_checksum: yes - checksum_algorithm: sha256 - register: git_stat - tags: [download, git] - -- name: Git | Fail if downloaded Git checksum is not correct - fail: - msg: "Downloaded Git checksum is not correct" - when: git_stat.stat.checksum != '0dc556503e3ce4699228fc910a8e4a8d81172635ac8e8e16a11be107254c4901' - tags: [download, git] - -- name: Git | Copy Git Install Configuration - win_copy: src='./resources/git_conf.inf' dest='C:\TEMP\git_conf.inf' - tags: [install, git] - -- name: Git | Install Git - raw: 'C:\TEMP\git.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART - /LOADINF=C:\TEMP\git_conf.inf /LOG=C:\TEMP\git_install_log.txt - /SAVEINF=C:\TEMP\git_install_log_inf.inf' - tags: [install, git] - -- name: Git | Enable long paths - raw: 'git config --global core.longpaths true' - tags: [install, git] - -- name: GYP | Check if GYP is already cloned - win_stat: path='C:\gyp' - register: gyp_stat - tags: [download, gyp] - -- name: GYP | Clone GYP repository - # Necessary for libuv test job - raw: 'git clone https://chromium.googlesource.com/external/gyp C:\gyp' - when: not gyp_stat.stat.exists - tags: [download, gyp] - -- name: Create C:\node-icu directory - win_file: path='C:\\node-icu' state=directory - -- name: ICU | Download ICU2C 54 zip - win_get_url: - url: 'http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.zip' - dest: 'C:\node-icu\icu4c-54_1-src.zip' - tags: [download, icu] - -- name: ICU | Download ICU2C 55 zip - win_get_url: - url: 'http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-src.zip' - dest: 'C:\node-icu\icu4c-55_1-src.zip' - tags: [download, icu] - -- name: ICU | Download ICU2C 56 zip - win_get_url: - url: 'http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.zip' - dest: 'C:\node-icu\icu4c-56_1-src.zip' - tags: [download, icu] - -- name: Jenkins | Download Jenkins Icon - win_get_url: - url: 'http://mirrors.jenkins-ci.org/art/jenkins-logo/favicon.ico' - dest: 'C:\jenkins.ico' - tags: [download, jenkins] - -- name: Jenkins | Create jenkins.bat - win_template: src='./resources/jenkins.bat' dest='C:\jenkins.bat' - tags: [setup, jenkins] - -- name: Jenkins | Create Jenkins Shortcuts - script: './resources/Jenkins-Shortcuts.ps1' - tags: [setup, jenkins] - -- name: Automatic Logon | Setup Automatic Logon - script: "./resources/Enable-Autologon.ps1 -UserName {{ ansible_ssh_user }} -Password {{ ansible_ssh_pass }}" - tags: [setup, autologon] - -- name: Reboot Machine - win_reboot: diff --git a/setup/windows/resources/Enable-Autologon.ps1 b/setup/windows/resources/Enable-Autologon.ps1 deleted file mode 100644 index 4a71dd79a..000000000 --- a/setup/windows/resources/Enable-Autologon.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -Param( - [string]$UserName = $(Throw 'No user name specified'), - [string]$Password = $(Throw 'No password specified') -) - -$RegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1" -type String -Set-ItemProperty $RegPath "DefaultUsername" -Value $UserName -type String -Set-ItemProperty $RegPath "DefaultPassword" -Value $Password -type String diff --git a/setup/windows/resources/git_conf.inf b/setup/windows/resources/git_conf.inf deleted file mode 100644 index 3c796c512..000000000 --- a/setup/windows/resources/git_conf.inf +++ /dev/null @@ -1,2 +0,0 @@ -[Setup] -PathOption=CmdTools diff --git a/setup/windows/resources/jenkins.bat b/setup/windows/resources/jenkins.bat deleted file mode 100644 index 646139fca..000000000 --- a/setup/windows/resources/jenkins.bat +++ /dev/null @@ -1,7 +0,0 @@ -C: -cd \ -:start -curl -L https://ci.nodejs.org/jnlpJars/slave.jar -o C:\slave.jar -java -Dhudson.remoting.Launcher.pingIntervalSec=10 -jar slave.jar -jnlpUrl https://ci.nodejs.org/computer/{{ server_id }}/slave-agent.jnlp -secret {{ server_secret }} -echo Restarting Jenkins... -goto start diff --git a/setup/windows/vcbt2015-ansible-playbook.yaml b/setup/windows/vcbt2015-ansible-playbook.yaml deleted file mode 100644 index c916ee6bb..000000000 --- a/setup/windows/vcbt2015-ansible-playbook.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- hosts: node-windows - - tasks: - - - name: Download and Install Windows Updates - win_updates: - register: update_result - - - name: Reboot machine if necessary - win_reboot: - when: update_result.reboot_required - - - name: Create C:\TEMP directory - win_file: path='C:\TEMP' state=directory - - - name: VCBT2015 | Download .NET Framework Setup - win_get_url: - url: 'http://go.microsoft.com/fwlink/?LinkId=671743' - dest: 'C:\TEMP\netfw.exe' - tags: [download, visualstudio] - - - name: VCBT2015 | Install .NET Framework - raw: 'C:\TEMP\netfw.exe /q /norestart - /log C:\TEMP\netfw_install_log.txt' - tags: [install, visualstudio] - - - name: VCBT2015 | Download Visual C++ Build Tools 2015 Setup - win_get_url: - url: 'https://go.microsoft.com/fwlink/?LinkId=691126' - dest: 'C:\TEMP\vcbt2015.exe' - tags: [download, visualstudio] - - - name: VCBT2015 | Install Visual C++ Build Tools 2015 - raw: 'C:\TEMP\vcbt2015.exe /Silent /NoRestart - /Full - /Log C:\TEMP\vsbt2015_install_log.txt' - tags: [install, visualstudio] - - - name: Reboot machine after Visual C++ Build Tools installation - win_reboot: - - - import_tasks: ./common-ansible-playbook.yaml - tags: common diff --git a/setup/windows/vs2013-ansible-playbook.yaml b/setup/windows/vs2013-ansible-playbook.yaml deleted file mode 100644 index df6994249..000000000 --- a/setup/windows/vs2013-ansible-playbook.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- hosts: node-windows - - tasks: - - - name: Download and Install Windows Updates - win_updates: - register: update_result - - - name: Reboot machine if necessary - win_reboot: - when: update_result.reboot_required - - - name: Create C:\TEMP directory - win_file: path='C:\TEMP' state=directory - - - name: VS2013 | Download Visual Studio Community 2013 Setup - win_get_url: - url: 'https://go.microsoft.com/fwlink/?LinkId=532495' - dest: 'C:\TEMP\vs2013_community.exe' - tags: [download, visualstudio] - - - name: VS2013 | Install Visual Studio Community 2013 - raw: 'C:\TEMP\vs2013_community.exe /Silent /NoRestart - /Log C:\TEMP\vs2013_install_log.txt' - tags: [install, visualstudio] - - - name: Reboot machine after Visual Studio installation - win_reboot: - - - import_tasks: ./common-ansible-playbook.yaml - tags: common diff --git a/setup/windows/vs2015-ansible-playbook.yaml b/setup/windows/vs2015-ansible-playbook.yaml deleted file mode 100644 index feece2a45..000000000 --- a/setup/windows/vs2015-ansible-playbook.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- hosts: node-windows - - tasks: - - - name: Download and Install Windows Updates - win_updates: - register: update_result - - - name: Reboot machine if necessary - win_reboot: - when: update_result.reboot_required - - - name: Create C:\TEMP directory - win_file: path='C:\TEMP' state=directory - - - name: VS2015 | Download Visual Studio Community 2015 Setup - win_get_url: - url: 'https://go.microsoft.com/fwlink/?LinkId=532606' - dest: 'C:\TEMP\vs_community.exe' - tags: [download, visualstudio] - - - name: VS2015 | Install Visual Studio Community 2015 - raw: 'C:\TEMP\vs_community.exe /Silent /NoRestart - /InstallSelectableItems NativeLanguageSupport_Group - /Log C:\TEMP\vs2015_install_log.txt' - tags: [install, visualstudio] - - - name: Reboot machine after Visual Studio installation - win_reboot: - - - import_tasks: ./common-ansible-playbook.yaml - tags: common