Skip to content

Commit

Permalink
Merge pull request #111 from anarion80/fix_docker_molecule
Browse files Browse the repository at this point in the history
Fix integration tests
  • Loading branch information
anarion80 authored Mar 4, 2024
2 parents a0ed2cb + 7a0744e commit a8dfd1a
Show file tree
Hide file tree
Showing 208 changed files with 370 additions and 230 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ steps:
- name: lint
image: python:3
commands:
- pip3 install ansible yamllint==1.27.1 ansible-lint==6.5
- pip3 install ansible yamllint==1.35.1 ansible-lint==24.2.0
- ansible-lint nas.yml
- yamllint .
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install test dependencies
run: pip3 install ansible yamllint==1.30.0 ansible-lint==6.14.6
run: pip3 install ansible yamllint==1.35.1 ansible-lint==24.2.0

- name: Ansible-lint
run: ansible-lint nas.yml
Expand All @@ -35,6 +35,6 @@ jobs:
run: yamllint .

- name: Lint docs
uses: articulate/actions-markdownlint@v1
uses: articulate/actions-markdownlint@main
with:
version: 0.32.2
2 changes: 1 addition & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Lint docs
uses: articulate/actions-markdownlint@v1
uses: articulate/actions-markdownlint@main
with:
version: 0.32.2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Lint docs
uses: articulate/actions-markdownlint@v1
uses: articulate/actions-markdownlint@main
with:
version: 0.32.2

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
matrix:
role: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
matrix:
role: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Molecule Test
uses: gofrolist/molecule-action@dfbfd1af6a77523c8a937a1532f92808065a00a4
uses: gofrolist/molecule-action@v2
with:
molecule_options: --base-config ../../tests/molecule/base.yml
molecule_options: --debug --base-config ../../tests/molecule/base.yml
molecule_command: test
molecule_working_dir: ${{ matrix.role }}
env:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
repos:
- repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.14.6
rev: v24.2.0
hooks:
- id: ansible-lint
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.30.0
rev: v1.35.1
hooks:
- id: yamllint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
rev: v0.39.0
hooks:
- id: markdownlint
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pre-commit
molecule==4.0.1
molecule[docker]==4.0.1
pytest>=7.0.0
molecule==24.2.0
molecule-plugins[docker]==23.5.3
pytest>=8.0.1
pytest_molecule>=2.0.0
5 changes: 3 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
roles:
- name: geerlingguy.docker
version: 6.0.0
version: 7.1.0

- name: geerlingguy.docker_arm
version: 5.0.0
Expand All @@ -16,9 +16,10 @@ roles:

- name: tigattack.mergerfs

- name: arillso.restic
- name: andrewrothstein.restic

collections:
- name: ansible.posix
- name: community.docker
- name: community.general
- name: community.windows
1 change: 1 addition & 0 deletions roles/activepieces/requirements.yml
2 changes: 1 addition & 1 deletion roles/admidio/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ admidio_mysql_memory: 1g
admidio_container_name: admidio
admidio_mysql_container_name: admidio-db
admidio_image_name: "admidio/admidio"
admidio_image_version: "v4.2.4"
admidio_image_version: "latest"
admidio_mysql_image_name: "mariadb"
admidio_mysql_image_version: latest
admidio_user_id: "1000"
Expand Down
1 change: 1 addition & 0 deletions roles/admidio/requirements.yml
1 change: 1 addition & 0 deletions roles/airsonic/requirements.yml
1 change: 1 addition & 0 deletions roles/authelia/requirements.yml
1 change: 1 addition & 0 deletions roles/authentik/requirements.yml
1 change: 1 addition & 0 deletions roles/barcodebuddy/requirements.yml
1 change: 1 addition & 0 deletions roles/bazarr/requirements.yml
1 change: 1 addition & 0 deletions roles/beets/requirements.yml
1 change: 1 addition & 0 deletions roles/blaze/requirements.yml
2 changes: 2 additions & 0 deletions roles/blocky/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ provisioner:
all:
blocky_enabled: true
blocky_data_directory: "/tmp"
blocky_dns_tcp_port: "8853"
blocky_dns_udp_port: "8853"
platforms:
- name: instance
image: geerlingguy/docker-ubuntu2204-ansible:latest
Expand Down
1 change: 1 addition & 0 deletions roles/blocky/requirements.yml
1 change: 1 addition & 0 deletions roles/booksonic/requirements.yml
1 change: 1 addition & 0 deletions roles/calibre/requirements.yml
1 change: 1 addition & 0 deletions roles/changedetection/requirements.yml
1 change: 1 addition & 0 deletions roles/chatpad/requirements.yml
1 change: 1 addition & 0 deletions roles/claper/requirements.yml
1 change: 1 addition & 0 deletions roles/cloudcmd/requirements.yml
16 changes: 8 additions & 8 deletions roles/cloudflare_ddns/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
cloudflare_ddns_enabled: false

# Data directory for config file
cloudflare_data_directory: "{{ docker_home }}/cloudflare_ddns"
cloudflare_ddns_data_directory: "{{ docker_home }}/cloudflare_ddns"

# Your domain name
cloudflare_zone: "{{ ansible_nas_domain }}"
cloudflare_ddns_zone: "{{ ansible_nas_domain }}"

# The hostname you want the container to update. You shouldn't need to change this.
cloudflare_host: "*.{{ cloudflare_zone }}"
cloudflare_ddns_host: "*.{{ cloudflare_ddns_zone }}"

# Cloudflare scoped token (https://github.com/joshuaavalon/docker-cloudflare#api-token)
# Make sure token permissions include #DNS:Edit and #Zone:Read
cloudflare_token: "abcdabcdabcd123412341234"
cloudflare_ddns_token: "abcdabcdabcd123412341234"

# Set to true to make traffic go through the CloudFlare CDN.
# Note that if the cloudflare host is a wildcard (the default), this must be false, as cloudflare
# does not support http proxy of wildcard CNAMEs.
cloudflare_proxy: false
cloudflare_ddns_proxy: false

# Set to AAAA to use set IPv6 records instead of IPv4 records.
cloudflare_type: "A"
cloudflare_ddns_type: "A"

# specs
cloudflare_memory: 512MB
cloudflare_ddns_memory: 512MB

# docker
cloudflare_container_name: cloudflare-ddns
cloudflare_ddns_container_name: cloudflare-ddns
2 changes: 1 addition & 1 deletion roles/cloudflare_ddns/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- name: Get container state
community.docker.docker_container_info:
name: "{{ cloudflare_container_name }}"
name: "{{ cloudflare_ddns_container_name }}"
register: result

- name: Check Cloudflare DDNS is running
Expand Down
2 changes: 1 addition & 1 deletion roles/cloudflare_ddns/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- name: Try and stop and remove Cloudflare DDNS
community.docker.docker_container:
name: "{{ cloudflare_container_name }}"
name: "{{ cloudflare_ddns_container_name }}"
state: absent
register: result

Expand Down
1 change: 1 addition & 0 deletions roles/cloudflare_ddns/requirements.yml
14 changes: 7 additions & 7 deletions roles/cloudflare_ddns/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
- name: Check for deprecated API key
ansible.builtin.fail:
msg: "Using a Cloudflare global API key is no longer supported. Please unset cloudflare_api_key and set cloudflare_token"
when: cloudflare_api_key is defined
when: cloudflare_ddns_api_key is defined

- name: Create cloudflare Dynamic DNS Directories
ansible.builtin.file:
path: "{{ cloudflare_data_directory }}"
path: "{{ cloudflare_ddns_data_directory }}"
state: directory

- name: Template Cloudflare Dynamic DNS config.yml with scoped token
ansible.builtin.template:
src: config.yml
dest: "{{ cloudflare_data_directory }}/config.yml"
dest: "{{ cloudflare_ddns_data_directory }}/config.yml"
register: template_files_result

- name: Cloudflare Dynamic DNS Container
community.docker.docker_container:
name: "{{ cloudflare_container_name }}"
name: "{{ cloudflare_ddns_container_name }}"
image: joshava/cloudflare-ddns:latest
pull: true
volumes:
- "{{ cloudflare_data_directory }}/config.yml:/app/config.yaml"
- "{{ cloudflare_ddns_data_directory }}/config.yml:/app/config.yaml"
restart_policy: unless-stopped
memory: "{{ cloudflare_memory }}"
memory: "{{ cloudflare_ddns_memory }}"
recreate: "{{ template_files_result is changed }}"
when: cloudflare_ddns_enabled is true

- name: Stop Cloudflare DDNS
block:
- name: Stop Cloudflare DDNS
community.docker.docker_container:
name: "{{ cloudflare_container_name }}"
name: "{{ cloudflare_ddns_container_name }}"
state: absent
when: cloudflare_ddns_enabled is false
1 change: 1 addition & 0 deletions roles/code-server/requirements.yml
1 change: 1 addition & 0 deletions roles/commafeed/requirements.yml
1 change: 1 addition & 0 deletions roles/couchpotato/requirements.yml
10 changes: 10 additions & 0 deletions roles/dashy/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
---
platforms:
- name: instance
image: geerlingguy/docker-ubuntu2204-ansible:latest
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /var/run/docker.sock:/var/run/docker.sock
- /tmp:/tmp
privileged: true
pre_build_image: true
provisioner:
inventory:
group_vars:
all:
dashy_enabled: true
dashy_data_directory: "/tmp/dashy"
1 change: 1 addition & 0 deletions roles/dashy/requirements.yml
1 change: 1 addition & 0 deletions roles/deluge/requirements.yml
1 change: 1 addition & 0 deletions roles/dockge/requirements.yml
1 change: 1 addition & 0 deletions roles/dokuwiki/requirements.yml
1 change: 1 addition & 0 deletions roles/drone-ci/requirements.yml
1 change: 1 addition & 0 deletions roles/dufs/requirements.yml
1 change: 1 addition & 0 deletions roles/duplicacy/requirements.yml
2 changes: 1 addition & 1 deletion roles/ebusd/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ebusd_devices:
ebusd_device: "/dev/ttyUSB0"
# ebusd_nodevicecheck: ""
# Only read from device, never write to it
ebusd_readonly: "" # "1"
# ebusd_readonly: "" # "1"
# Send an initial escape symbol after connecting device
# ebusd_initsend: ""
# Extra transfer latency in ms
Expand Down
1 change: 1 addition & 0 deletions roles/ebusd/requirements.yml
1 change: 1 addition & 0 deletions roles/emby/requirements.yml
1 change: 1 addition & 0 deletions roles/esphome/requirements.yml
1 change: 1 addition & 0 deletions roles/excalidraw/requirements.yml
1 change: 1 addition & 0 deletions roles/firefly/requirements.yml
1 change: 1 addition & 0 deletions roles/flame/requirements.yml
1 change: 1 addition & 0 deletions roles/flarum/requirements.yml
1 change: 1 addition & 0 deletions roles/flatnotes/requirements.yml
1 change: 1 addition & 0 deletions roles/freshrss/requirements.yml
2 changes: 1 addition & 1 deletion roles/frigate/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ frigate_mqtt_client_id: "frigate"
frigate_mqtt_user: "user"
frigate_mqtt_password: "password"
frigate_devices: # add device mapping as needed
- /dev/bus/usb:/dev/bus/usb
# - /dev/bus/usb:/dev/bus/usb
# - /dev/apex_0:/dev/apex_0
# - /dev/dri/renderD128
1 change: 1 addition & 0 deletions roles/frigate/requirements.yml
1 change: 1 addition & 0 deletions roles/gaps/requirements.yml
1 change: 1 addition & 0 deletions roles/get_iplayer/requirements.yml
1 change: 1 addition & 0 deletions roles/ghost/requirements.yml
1 change: 1 addition & 0 deletions roles/gitea/requirements.yml
1 change: 1 addition & 0 deletions roles/gitlab/requirements.yml
1 change: 1 addition & 0 deletions roles/glances/requirements.yml
1 change: 1 addition & 0 deletions roles/gotify/requirements.yml
Loading

0 comments on commit a8dfd1a

Please sign in to comment.