diff --git a/.github/workflows/collection-continuous-integration.yml b/.github/workflows/collection-continuous-integration.yml index 1f0379d..3dc896b 100644 --- a/.github/workflows/collection-continuous-integration.yml +++ b/.github/workflows/collection-continuous-integration.yml @@ -89,7 +89,8 @@ jobs: ~/.local/bin/ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz - name: Run collection sanity tests run: >- - ~/.local/bin/ansible-test sanity --color --requirements --docker --python "${{ matrix.python-version }}" -vvv + ~/.local/bin/ansible-test sanity --color --requirements --python "${{ matrix.python-version }}" -vvv + plugins/ tests/ working-directory: >- /home/runner/.ansible/collections/ansible_collections/containers/podman diff --git a/README.md b/README.md index 0341322..a7fe109 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,105 @@ [![GitHub Actions CI/CD build status — Collection test suite](https://github.com/containers/ansible-podman-collections/workflows/Collection%20build%20and%20tests/badge.svg?branch=master)](https://github.com/containers/ansible-podman-collections/actions?query=workflow%3A%22Collection%20build%20and%20tests) -Ansible Collection: containers.podman -================================================= -Basic Ansible modules for podman containers. +# Ansible Collection: containers.podman + +This repo hosts the `containers.podman` Ansible Collection. + +The collection includes the Podman container plugins to help the build and management of Podman containers. + +## Installation and Usage + +### Installing the Collection from Ansible Galaxy + +Before using the Podman collection, you need to install the collection with the `ansible-galaxy` CLI: + +`ansible-galaxy collection install containers.podman` + +You can also include it in a `requirements.yml` file and install it via +`ansible-galaxy collection install -r requirements.yml` using the format: ```yaml -- name: Run container - podman_container: - - name: web - state: present - image: ubuntu:14.04 - command: "sleep 1d" -``` - -Install collection from galaxy: - -```bash -ansible-galaxy collection install containers.podman +collections: +- name: containers.podman ``` or clone by your own: ```bash -mkdir -p ~/.ansible/collections/ansible_collections/containers/podman/ -git clone https://github.com/containers/ansible-podman-collections.git ~/.ansible/collections/ansible_collections/containers/podman/ +mkdir -p ~/.ansible/collections/ansible_collections/containers +git clone https://github.com/containers/ansible-podman-collections.git ~/.ansible/collections/ansible_collections/containers/podman ``` + +### Playbooks + +To use a module from Podman collection, please reference the full namespace, collection name, +and modules name that you want to use: + +```yaml +--- +- name: Using Podman collection + hosts: localhost + tasks: + - name: Run redis container + containers.podman.podman_container: + name: myredis + image: redis + command: redis-server --appendonly yes + state: present + recreate: yes + expose: + - 6379 + volumes_from: + - mydata +``` + +Or you can add full namepsace and collecton name in the `collections` element: + +```yaml +--- +- name: Using Podman collection + hosts: localhost + collections: + - containers.podman + tasks: + - name: Build and push an image using existing credentials + podman_image: + name: nginx + path: /path/to/build/dir + push: yes + push_args: + dest: quay.io/acme +``` + +## Contributing + +We are accepting Github pull requests and issues. +There are many ways in which you can participate in the project, for example: + +- Submit bugs and feature requests, and help us verify them +- Submit and review source code changes in Github pull requests +- Add new modules for Podman containers and images + +## Testing and Development + +If you want to develop new content for this collection or improve what is already +here, the easiest way to work on the collection is to clone it into one of the configured +[`COLLECTIONS_PATHS`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths), +and work on it there. + +### Testing with `ansible-test` + +We use `ansible-test` for sanity. + +## More Information + +TBD + +## Communication + +Please submit Github issues for communication any issues. +You can ask Podman related questions on `#podman` channel of Ansible Podman questions +on `#ansible-podman` channel on Freenode IRC. + +## License + +Apache-2.0 diff --git a/galaxy.yml b/galaxy.yml index 7c5dd36..461d670 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -15,11 +15,12 @@ documentation: https://github.com/containers/ansible-podman-collections homepage: https://github.com/containers/ansible-podman-collections issues: https://github.com/containers/ansible-podman-collections/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc build_ignore: + - ci + - tests/output - build_artifact - "*.tar.gz" - - zuul.yaml - - .gitignore - - tests/output + - ".gitignore" - ".history" - ".vscode" - ".idea" + - ".github" diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 73a711c..f774b9e 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -8,10 +8,13 @@ plugins/modules/podman_image_info.py validate-modules:parameter-type-not-in-doc plugins/modules/podman_container.py validate-modules:invalid-ansiblemodule-schema plugins/modules/podman_container.py validate-modules:missing-gplv3-license plugins/modules/podman_container.py validate-modules:parameter-list-no-elements -plugins/modules/podman_container.py import-3.7!skip +plugins/modules/podman_container.py import-2.6!skip +plugins/modules/podman_container.py compile-2.6!skip plugins/modules/podman_container.py import-2.7!skip -ci/run_connection_test.sh shebang!skip -ci/run_containers_tests.sh shellcheck!skip -ci/run_containers_tests.sh shebang!skip +plugins/modules/podman_container.py import-3.5!skip +plugins/modules/podman_container.py import-3.6!skip +plugins/modules/podman_container.py import-3.7!skip +plugins/modules/podman_container.py import-3.8!skip +plugins/modules/podman_container.py import-3.9!skip tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086 diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 87be59c..dec76af 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -3,10 +3,12 @@ plugins/modules/podman_image.py validate-modules:parameter-type-not-in-doc plugins/modules/podman_image.py validate-modules:undocumented-parameter plugins/modules/podman_image_info.py validate-modules:parameter-type-not-in-doc plugins/modules/podman_container.py validate-modules!skip -plugins/modules/podman_container.py import-3.7!skip +plugins/modules/podman_container.py import-2.6!skip +plugins/modules/podman_container.py compile-2.6!skip plugins/modules/podman_container.py import-2.7!skip -ci/run_connection_test.sh shebang!skip -ci/run_containers_tests.sh shellcheck!skip -ci/run_containers_tests.sh shebang!skip +plugins/modules/podman_container.py import-3.5!skip +plugins/modules/podman_container.py import-3.6!skip +plugins/modules/podman_container.py import-3.7!skip +plugins/modules/podman_container.py import-3.8!skip tests/integration/targets/connection_buildah/runme.sh shellcheck:SC2086 tests/integration/targets/connection_podman/runme.sh shellcheck:SC2086