Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk committed Nov 28, 2023
1 parent d2b6c7b commit fd844be
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 67 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'deployments/ansible/galaxy.yml'
branches:
- main
- ansible-win-docker-test
pull_request:
paths:
- '.github/workflows/ansible.yml'
Expand Down Expand Up @@ -124,7 +125,7 @@ jobs:
# Need to run on macos-12 since it is the only image with native support for ansible, vagrant, and virtualbox.
# https://docs.ansible.com/ansible/latest/os_guide/windows_faq.html#windows-faq-ansible
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
runs-on: macos-12
runs-on: ${{ matrix.distro }}
timeout-minutes: 75
strategy:
fail-fast: false
Expand All @@ -134,14 +135,8 @@ jobs:
- ansible~=6.0
- ansible~=7.0
distro:
- "2012"
- "2016"
- "2019"
- "2022"
scenario:
- default
- custom_vars
- with_instrumentation
- windows-2019
- windows-2022
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
Expand All @@ -151,11 +146,11 @@ jobs:
path: "${{ github.workspace }}/requirements.txt"
contents: |
${{ matrix.ansible }}
ansible-compat==2.2.7
molecule==3.3.0
molecule-docker==0.2.4
docker==5.0.0
ansible-lint==5.4.0
molecule==4.0.4
molecule-vagrant==2.0.0
pywinrm==0.4.3
urllib3<2
- name: Set up Python 3.
uses: actions/setup-python@v4
Expand All @@ -164,11 +159,19 @@ jobs:
cache: 'pip'
cache-dependency-path: "${{ github.workspace }}/requirements.txt"

- uses: Vampire/setup-wsl@v2
with:
distribution: Ubuntu-20.04

- name: Install test dependencies.
run: pip3 install --use-pep517 -r ${GITHUB_WORKSPACE}/requirements.txt
shell: wsl-bash {0}
run: |
python --version
pip3 install --use-pep517 -r ${{ github.workspace }}/requirements.txt
- name: Run Molecule tests.
run: molecule --debug -v --base-config ./molecule/config/windows.yml test -s ${{ matrix.scenario }} -p ${{ matrix.distro }}
shell: wsl-bash {0}
run: molecule --debug -v --base-config ./molecule/config/windows.yml test -p ${{ matrix.distro }} --all
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
Expand Down
58 changes: 6 additions & 52 deletions deployments/ansible/molecule/config/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,15 @@ dependency:
options:
requirements-file: ./molecule/requirements.yml
driver:
name: vagrant
provider:
name: virtualbox
name: docker
platforms:
- name: "2012"
box: devopsgroup-io/windows_server-2012r2-standard-amd64-nocm
box_version: 1.67.0
cpus: 2
memory: 4096
instance_raw_config_args: &vagrant_args
- "vm.boot_timeout = 1200"
- "vm.communicator = 'winrm'"
- "vm.network 'forwarded_port', guest: 5985, host: 55985"
- "winrm.basic_auth_only = true"
- "winrm.transport = 'plaintext'"
- "winrm.username = 'vagrant'"
- "winrm.password = 'vagrant'"
- "winrm.retry_limit = 50"
- "winrm.retry_delay = 10"
- name: "2016"
box: cdaf/WindowsServer
box_version: 2022.09.01
cpus: 2
memory: 4096
instance_raw_config_args: *vagrant_args
- name: "2019"
box: gusztavvargadr/windows-server-2019-standard
box_version: 1809.0.2305
cpus: 2
memory: 4096
instance_raw_config_args: *vagrant_args
- name: "2022"
box: gusztavvargadr/iis-windows-server
box_version: 10.2102.2306
cpus: 2
memory: 4096
instance_raw_config_args: *vagrant_args
- name: "windows-2019"
image: mcr.microsoft.com/windows/servercore:1809
- name: "windows-2022"
image: mcr.microsoft.com/windows/servercore:ltsc2022

provisioner:
name: ansible
env:
ANSIBLE_ROLES_PATH: ../../roles
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: 'YES'
connection_options:
ansible_connection: winrm
ansible_host: 127.0.0.1
ansible_port: 55985
ansible_become_method: runas
ansible_become_user: vagrant
ansible_password: vagrant
ansible_user: vagrant
ansible_winrm_scheme: http
ansible_winrm_transport: basic
ansible_winrm_server_cert_validation: ignore
ansible_winrm_operation_timeout_sec: 60
ansible_winrm_read_timeout_sec: 90
playbooks:
converge: windows-converge.yml
prepare: ../default/windows-prepare.yml
Expand Down

0 comments on commit fd844be

Please sign in to comment.