Skip to content

Commit

Permalink
Fix failing tests (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten authored Dec 4, 2023
1 parent 91ba9ea commit 4ddf633
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 46 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ jobs:
fail-fast: false
matrix:
include:
- distro: debian8
- distro: debian9
- distro: debian10
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
- distro: debian11
- distro: debian12
- distro: ubuntu1804
- distro: ubuntu2004
- distro: ubuntu2204

steps:
- name: Check out the codebase
Expand All @@ -65,8 +63,8 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker

run: |
pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker
- name: Run Molecule tests
run: |
molecule test
Expand Down
34 changes: 17 additions & 17 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
role = File.basename(File.expand_path(File.dirname(__FILE__)))

boxes = [
{
:name => "ubuntu-1604",
:box => "bento/ubuntu-16.04",
:ip => '10.0.0.12',
:cpu => "50",
:ram => "256"
},
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
Expand All @@ -23,26 +16,33 @@ boxes = [
:box => "bento/ubuntu-20.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "384"
:ram => "512"
},
{
:name => "ubuntu-2204",
:box => "bento/ubuntu-22.04",
:ip => '10.0.0.15',
:cpu => "50",
:ram => "512"
},
{
:name => "debian-8",
:box => "bento/debian-8",
:ip => '10.0.0.16',
:name => "debian-10",
:box => "bento/debian-10",
:ip => '10.0.0.18',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-9",
:box => "bento/debian-9",
:ip => '10.0.0.17',
:name => "debian-11",
:box => "bento/debian-11",
:ip => '10.0.0.19',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-10",
:box => "bento/debian-10",
:ip => '10.0.0.18',
:name => "debian-12",
:box => "bento/debian-12",
:ip => '10.0.0.20',
:cpu => "50",
:ram => "256"
},
Expand Down
6 changes: 3 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- xenial
- bionic
- focal
- jammy
- name: Debian
versions:
- jessie
- stretch
- buster
- bullseye
- bookworm
galaxy_tags:
- development
- packaging
Expand Down
6 changes: 1 addition & 5 deletions molecule/default/collections.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
---
collections:
- name: community.docker
version: '>=1.2.0,<2'
- name: community.general
version: '>=2,<3'
collections: []
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

- name: updatedb

Check warning on line 53 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 53 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 53 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 53 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.import_tasks: updatedb.yml
when: docker_manage_updatedb
when: docker_manage_updatedb | bool
tags:
- configuration
- docker
Expand Down
10 changes: 3 additions & 7 deletions tasks/repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
- name: repository | dependencies

Check warning on line 3 in tasks/repository.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/repository.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/repository.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.

Check warning on line 3 in tasks/repository.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.apt:
name: "{{ docker_dependencies_pre }}"
name: "{{ ' '.join(docker_dependencies_pre).split() }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
Expand All @@ -11,8 +11,8 @@

# Old python (TLS issues)
- name: repository | old python
when: ansible_python_version is version('2.7.9', '<')
block:

- name: repository | create (download) directory
ansible.builtin.file:
path: "{{ docker_downloads_path }}"
Expand Down Expand Up @@ -42,12 +42,10 @@
tags:
- docker-repository-public-key

when: ansible_python_version is version('2.7.9', '<')

# New python
- name: repository | new python
when: ansible_python_version is version('2.7.9', '>=')
block:

- name: repository | add public key
ansible.builtin.apt_key:
id: "{{ item.id }}"
Expand All @@ -57,8 +55,6 @@
tags:
- docker-repository-public-key

when: ansible_python_version is version('2.7.9', '>=')

- name: repository | add
ansible.builtin.apt_repository:
repo: "{{ item.type }} {{ item.url }} {{ item.component }}"
Expand Down
1 change: 1 addition & 0 deletions tasks/updatedb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
ansible.builtin.command: >
/usr/bin/updatedb -e /var/lib/docker
when: _updatedb_file_stats.stat.exists
changed_when: true
tags:
- docker-updatedb-disable-indexing
3 changes: 1 addition & 2 deletions templates/etc/default/docker.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# {{ ansible_managed }}

{{ ansible_managed | comment }}
# Docker Upstart and SysVinit configuration file

#
Expand Down
5 changes: 2 additions & 3 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# vars file
---
docker_dependencies_pre_dummy_package: apt
docker_dependencies_pre:
- software-properties-common
- dirmngr
- apt-transport-https
- curl
- apparmor
- "{{ (ansible_distribution == 'Ubuntu') | ternary('linux-image-extra-virtual', docker_dependencies_pre_dummy_package) }}"
- "{{ (ansible_distribution == 'Ubuntu') | ternary('cgroup-lite', docker_dependencies_pre_dummy_package) }}"
- "{{ (ansible_distribution == 'Ubuntu') | ternary('linux-image-extra-virtual', '') }}"
- "{{ (ansible_distribution == 'Ubuntu') | ternary('cgroup-lite', '') }}"

docker_apt_keys:
- id: 8D81803C0EBFCD88
Expand Down

0 comments on commit 4ddf633

Please sign in to comment.