diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml index c8f77de671..241a5a25fb 100644 --- a/.github/workflows/ansible.yml +++ b/.github/workflows/ansible.yml @@ -88,7 +88,7 @@ jobs: urllib3<2 - name: Set up Python 3. - uses: actions/setup-python@v5 + uses: actions/setup-python@v5.5.0 with: python-version: '3.11' cache: 'pip' @@ -140,9 +140,25 @@ jobs: sudo apt update && sudo apt install -y virtualbox wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list - sudo apt update && sudo apt install -y vagrant + sudo apt update && sudo apt install -y vagrant=2.4.3-1 - uses: DamianReeves/write-file-action@v1.3 + if: ${{ contains(matrix.ansible, '8.7.0') }} + with: + path: "${{ github.workspace }}/requirements.txt" + contents: | + ${{ matrix.ansible }} + ansible-compat==4.1.11 + ansible-core==2.15.13 + ansible-lint==6.22.2 + molecule==6.0.3 + molecule-plugins[vagrant]==23.5.0 + pywinrm==0.4.3 + yamllint==1.37.0 + cryptography==44.0.2 + + - uses: DamianReeves/write-file-action@v1.3 + if: ${{ contains(matrix.ansible, '9.2.0') }} with: path: "${{ github.workspace }}/requirements.txt" contents: | @@ -172,6 +188,18 @@ jobs: url=$( echo "$json" | jq -r ".versions[] | select(.version == \"${box_version}\") | .providers[] | select(.name == \"virtualbox\") | .url" ) wget -nv -O /tmp/vagrant.box $url + - name: Clean VirtualBox cache + run: | + # Related issues: + # https://bbs.archlinux.org/viewtopic.php?id=298056 + # https://forums.virtualbox.org/viewtopic.php?t=112438 + # https://forums.virtualbox.org/viewtopic.php?t=112481 + echo "3" | sudo tee /proc/sys/vm/drop_caches + echo "1" | sudo tee /proc/sys/vm/drop_caches + - name: free after clean cache + run: | + free -h + - name: Run Molecule tests. run: molecule --debug -v --base-config ./molecule/config/windows.yml test -s ${{ matrix.scenario }} -p ${{ matrix.distro }} env: diff --git a/deployments/ansible/molecule/config/windows.yml b/deployments/ansible/molecule/config/windows.yml index 84470a7037..568666cf44 100644 --- a/deployments/ansible/molecule/config/windows.yml +++ b/deployments/ansible/molecule/config/windows.yml @@ -9,16 +9,16 @@ driver: name: virtualbox platforms: - name: "2016" - box: cdaf/WindowsServer - box_version: ${MOLECULE_VAGRANT_BOX_VERSION:-2022.09.01} + box: StefanScherer/windows_2016 + box_version: ${MOLECULE_VAGRANT_BOX_VERSION:-2019.02.14} box_url: ${MOLECULE_VAGRANT_BOX_URL} cpus: 2 - memory: 4096 + memory: 8192 provider_options: gui: false linked_clone: true instance_raw_config_args: &vagrant_args - - "vm.boot_timeout = 1200" + - "vm.boot_timeout = 2400" - "vm.communicator = 'winrm'" - "vm.guest = :windows" - "vm.network 'forwarded_port', guest: 5985, host: 55985" @@ -29,11 +29,11 @@ platforms: - "winrm.retry_limit = 50" - "winrm.retry_delay = 10" - name: "2019" - box: gusztavvargadr/windows-server-2019-standard - box_version: ${MOLECULE_VAGRANT_BOX_VERSION:-1809.0.2312} + box: StefanScherer/windows_2019 + box_version: ${MOLECULE_VAGRANT_BOX_VERSION:-2021.05.15} box_url: ${MOLECULE_VAGRANT_BOX_URL} cpus: 2 - memory: 4096 + memory: 8192 provider_options: gui: false linked_clone: true @@ -43,7 +43,7 @@ platforms: box_version: ${MOLECULE_VAGRANT_BOX_VERSION:-2102.0.2312} box_url: ${MOLECULE_VAGRANT_BOX_URL} cpus: 2 - memory: 4096 + memory: 8192 provider_options: gui: false linked_clone: true