-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.52 KB
/
Windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: Windows Ansible Role Test
on:
push:
branches:
- master
schedule:
- cron: '0 5 * * 2' # At 5AM on Tuesdays
jobs:
integration:
name: Integration
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
- name: Setup WinRM.
run: |
Write-Host "Changing $env:UserName password to 'AnsibleTest999'"
$NewPassword = ConvertTo-SecureString "AnsibleTest999" -AsPlainText -Force
Set-LocalUser -Name $env:UserName -Password $NewPassword
Write-Host "Setting up WinRM CredSSP"
$url = "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
$file = "$env:temp\ConfigureRemotingForAnsible.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
PowerShell.exe -ExecutionPolicy ByPass -File $file -Verbose -EnableCredSSP -DisableBasicAuth -ForceNewSSLCert
- name: Setup WSL.
uses: Vampire/[email protected]
with:
additional-packages: dos2unix python3 python3-pip
distribution: Ubuntu-20.04
- name: Install task.
shell: wsl-bash {0}
run: |
dos2unix start.sh
bash start.sh
- name: Test the role.
env:
ANSIBLE_FORCE_COLOR: '1'
shell: wsl-bash {0}
run: |
export WINDOWS_ANSIBLE_TEST=true
task ansible:test:local