Skip to content

Commit

Permalink
Use community.library_inventory_filtering_v1 collection.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Dec 7, 2023
1 parent 751ebba commit d435bf1
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 141 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
pull-request-change-detection: 'true'
testing-type: sanity
pre-test-cmd: >-
git clone --depth=1 --single-branch --branch stable-1 https://github.com/ansible-collections/community.library_inventory_filtering.git ../../community/library_inventory_filtering_v1
units:
# Ansible-test on various stable branches does not yet work well with cgroups v2.
Expand All @@ -72,16 +74,16 @@ jobs:
- '2.13'

steps:
- name: >-
Perform unit testing against
Ansible version ${{ matrix.ansible }}
- name: Perform unit testing against Ansible version ${{ matrix.ansible }}
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
ansible-core-version: stable-${{ matrix.ansible }}
coverage: ${{ github.event_name == 'schedule' && 'always' || 'never' }}
pull-request-change-detection: 'true'
testing-type: units
pre-test-cmd: >-
git clone --depth=1 --single-branch --branch stable-1 https://github.com/ansible-collections/community.library_inventory_filtering.git ../../community/library_inventory_filtering_v1
integration:
# Ansible-test on various stable branches does not yet work well with cgroups v2.
Expand Down Expand Up @@ -182,10 +184,7 @@ jobs:
target: azp/5/

steps:
- name: >-
Perform integration testing against
Ansible version ${{ matrix.ansible }}
under Python ${{ matrix.python }}
- name: Perform integration testing against Ansible version ${{ matrix.ansible }} under Python ${{ matrix.python }}
uses: felixfontein/ansible-test-gh-action@main
with:
ansible-core-github-repository-slug: ${{ contains(fromJson('["2.10", "2.11"]'), matrix.ansible) && 'felixfontein/ansible' || 'ansible/ansible' }}
Expand All @@ -203,6 +202,8 @@ jobs:
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.crypto.git ../../community/crypto
;
git clone --depth=1 --single-branch https://github.com/ansible-collections/community.general.git ../../community/general
;
git clone --depth=1 --single-branch --branch stable-1 https://github.com/ansible-collections/community.library_inventory_filtering.git ../../community/library_inventory_filtering_v1
${{ matrix.extra-constraints && format('; echo ''{0}'' >> tests/utils/constraints.txt', matrix.extra-constraints) || '' }}
;
cat tests/utils/constraints.txt
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
init-extra-html-theme-options: |
documentation_home_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/branch/main/
render-file-line: '> * `$<status>` [$<path_tail>](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr/${{ github.event.number }}/$<path_tail>)'
extra-collections: community.library_inventory_filtering_v1

publish-docs-gh-pages:
# for now we won't run this on forks
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
init-html-short-title: Community.Docker Collection Docs
init-extra-html-theme-options: |
documentation_home_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/branch/main/
extra-collections: community.library_inventory_filtering_v1

publish-docs-gh-pages:
# for now we won't run this on forks
Expand Down
2 changes: 2 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ license:
#license_file: COPYING
tags:
- docker
dependencies:
community.library_inventory_filtering_v1: '>=0.1.0'
repository: https://github.com/ansible-collections/community.docker
#documentation: https://github.com/ansible-collection-migration/community.REPO_NAME/tree/main/docs
homepage: https://github.com/ansible-collections/community.docker
Expand Down
36 changes: 0 additions & 36 deletions plugins/doc_fragments/inventory_filter.py

This file was deleted.

4 changes: 2 additions & 2 deletions plugins/inventory/docker_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
extends_documentation_fragment:
- ansible.builtin.constructed
- community.docker.docker.api_documentation
- community.docker.inventory_filter
- community.library_inventory_filtering_v1.inventory_filter
description:
- Reads inventories from the Docker API.
- Uses a YAML configuration file that ends with C(docker.[yml|yaml]).
Expand Down Expand Up @@ -179,7 +179,7 @@
)

from ansible_collections.community.docker.plugins.module_utils._api.errors import APIError, DockerException
from ansible_collections.community.docker.plugins.plugin_utils.inventory_filter import parse_filters, filter_host
from ansible_collections.community.library_inventory_filtering_v1.plugins.plugin_utils.inventory_filter import parse_filters, filter_host

MIN_DOCKER_API = None

Expand Down
4 changes: 2 additions & 2 deletions plugins/inventory/docker_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- L(Docker Machine,https://docs.docker.com/machine/)
extends_documentation_fragment:
- ansible.builtin.constructed
- community.docker.inventory_filter
- community.library_inventory_filtering_v1.inventory_filter
description:
- Get inventory hosts from Docker Machine.
- Uses a YAML configuration file that ends with docker_machine.(yml|yaml).
Expand Down Expand Up @@ -97,7 +97,7 @@
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
from ansible.utils.display import Display

from ansible_collections.community.docker.plugins.plugin_utils.inventory_filter import parse_filters, filter_host
from ansible_collections.community.library_inventory_filtering_v1.plugins.plugin_utils.inventory_filter import parse_filters, filter_host

import json
import re
Expand Down
4 changes: 2 additions & 2 deletions plugins/inventory/docker_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- L(Docker SDK for Python,https://docker-py.readthedocs.io/en/stable/) >= 1.10.0
extends_documentation_fragment:
- ansible.builtin.constructed
- community.docker.inventory_filter
- community.library_inventory_filtering_v1.inventory_filter
description:
- Reads inventories from the Docker swarm API.
- Uses a YAML configuration file docker_swarm.[yml|yaml].
Expand Down Expand Up @@ -158,7 +158,7 @@
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable
from ansible.parsing.utils.addresses import parse_address

from ansible_collections.community.docker.plugins.plugin_utils.inventory_filter import parse_filters, filter_host
from ansible_collections.community.library_inventory_filtering_v1.plugins.plugin_utils.inventory_filter import parse_filters, filter_host

try:
import docker
Expand Down
91 changes: 0 additions & 91 deletions plugins/plugin_utils/inventory_filter.py

This file was deleted.

3 changes: 2 additions & 1 deletion tests/integration/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

collections:
- ansible.posix
- community.internal_test_tools
- community.crypto
- community.general
- community.internal_test_tools
- community.library_inventory_filtering_v1
1 change: 1 addition & 0 deletions tests/unit/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

collections:
- community.internal_test_tools
- community.library_inventory_filtering_v1

0 comments on commit d435bf1

Please sign in to comment.