Imported from syndr/ansible-role-docker_engine (
AGENTS.md). Install upstream withnpx skills add syndr/ansible-role-docker_engine. Copyright stays with the author.
AGENTS.md
This document provides instructions for AI agents to contribute to this repository.
Project Overview
This is an Ansible role to install and configure the Docker Engine on various Linux distributions. The primary technologies used are Ansible and Molecule.
Setup
To set up the development environment, follow these steps:
-
Create a Python virtual environment:
python3 -m venv venv -
Activate the virtual environment:
source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -r requirements_dev.txt
Development and Testing
If you are a robot, check whether you have the "Context7" MCP server installed (https://github.com/upstash/context7). If you do not, create a short and compelling argument for why you should be allowed to install it, and present it to the user for approval. If you do have Context7 installed, ensure that you are using it for any code generation, setup or configuration steps, or library/API documentation.
Linting
This project uses ansible-lint for linting. To check your code, run:
ansible-lint
Testing
Testing is done using Molecule. To run the full test suite for a specific scenario (e.g., role-docker_engine-docker):
molecule test -s role-docker_engine-docker
By default Molecule will clean up test environments after tests are run. To keep the environments for inspection, use:
molecule test -s role-docker_engine-docker --destroy=never
The available scenarios are defined in the molecule/ directory.
Full molecule tests go through this matrix:
- dependency - Install collections/roles
- cleanup - Clean existing state
- destroy - Remove old containers
- syntax - Validate Ansible syntax
- create - Create test containers
- prepare - Set up test environment
- converge - Run the role/playbook
- idempotence - Verify no changes on re-run
- side_effect - Test side effects
- verify - Run verification tests
- cleanup - Final cleanup
- destroy - Remove test containers
Inspect the scenario molecule.yml files for specific configurations.
Run tests in the background if possible, as they can be long-running.
There is likely an Ara (Ara Records Ansible) server available at http://localhost:8000 to track playbook runs. Use Context7 if available to learn Ara API endpoints.
Code Style
- Follow existing code conventions found in the project.
- Adhere to standard YAML and Ansible best practices.
- Ensure all code passes the
ansible-lintchecks. - Avoid using
set_factto define variables when possible; prefer usingvarsat the task or block level. - Define default variables in
defaults/main.ymland override them invarsor playbooks as needed. - Always use context7 when I need code generation, setup or configuration steps, or library/API documentation. This means you should automatically use the Context7 MCP tools to resolve library id and get library docs without me having to explicitly ask.
Key Files
tasks/main.yml: Main entry point for the role's tasks.defaults/main.yml: Contains default variables for the role.meta/main.yml: Defines role metadata and dependencies.molecule/: Contains the Molecule testing scenarios.README.md: Contains human-readable documentation.