Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
profile: moderate

exclude_paths:
- .git/
- .github/
- tests/
- venv/
- venv-ansible-*/

skip_list:
- yaml[line-length]
- name[casing]
- var-naming[no-role-prefix]
- schema[meta]

warn_list:
- experimental
- role-name

enable_list:
- yaml

use_default_rules: true
1 change: 1 addition & 0 deletions .ansible/roles/docker-deploy
1 change: 1 addition & 0 deletions .ansible/roles/fccn.ansible_docker_deploy
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---

## Description
A clear and concise description of the bug.

## Environment
- **Ansible Version**: [e.g., 2.15.0]
- **OS**: [e.g., Ubuntu 22.04]
- **Docker Version**: [e.g., 24.0.0]
- **Docker Compose Version**: [e.g., 2.20.0]

## Playbook/Variables
```yaml
# Paste your playbook or variable configuration here
# (Remove any sensitive information)
```

## Steps to Reproduce
1. Run playbook with...
2. Configure variable...
3. See error...

## Expected Behavior
A clear description of what you expected to happen.

## Actual Behavior
What actually happened.

## Error Output
```
Paste any error messages or logs here
```

## Additional Context
Add any other context about the problem here.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

## Is your feature request related to a problem?
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

## Describe the solution you'd like
A clear and concise description of what you want to happen.

## Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

## Example Usage
```yaml
# Show how you would like to use this feature
```

## Additional context
Add any other context or screenshots about the feature request here.

## Would you like to implement this feature?
- [ ] Yes, I can work on this
- [ ] No, but I can help test it
- [ ] No, just requesting
32 changes: 32 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Pull Request

## Description
Brief description of what this PR does.

## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Test improvement

## Testing
- [ ] All existing tests pass
- [ ] New tests added for new features
- [ ] Manual testing performed

## Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] CHANGELOG.md updated with my changes

## Related Issues
Closes #(issue number)

## Additional Notes
Any additional information that reviewers should know.
163 changes: 163 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
name: CI

on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible ansible-lint yamllint

- name: Run yamllint
run: |
yamllint -c .yamllint .
continue-on-error: true

- name: Run ansible-lint
run: |
ansible-lint
continue-on-error: true

- name: Ansible syntax check
run: |
printf '[defaults]\nroles_path=../' > ansible.cfg
ansible-playbook tests/test.yml -i tests/inventory --syntax-check

test-syntax:
name: Test Syntax (Ansible ${{ matrix.ansible-version }})
runs-on: ubuntu-latest
strategy:
matrix:
ansible-version:
- '5' # ansible 5.x (includes ansible-core 2.12)
- '6' # ansible 6.x (includes ansible-core 2.13)
- '7' # ansible 7.x (includes ansible-core 2.14)
- '8' # ansible 8.x (includes ansible-core 2.15)
- '9' # ansible 9.x (includes ansible-core 2.16)
- 'latest'
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version || '3.11' }}

- name: Install Ansible ${{ matrix.ansible-version }}
run: |
python -m pip install --upgrade pip
if [ "${{ matrix.ansible-version }}" = "latest" ]; then
pip install ansible
else
pip install "ansible~=${{ matrix.ansible-version }}.0"
fi

- name: Display Ansible version
run: ansible --version

- name: Syntax check
run: |
printf '[defaults]\nroles_path=../' > ansible.cfg
ansible-playbook tests/test.yml -i tests/inventory --syntax-check

test-integration:
name: Integration Tests (Ansible ${{ matrix.ansible-version }})
runs-on: ubuntu-latest
needs: [lint, test-syntax]
strategy:
matrix:
ansible-version:
- '5' # Oldest supported version
- '7' # Mid-range version
- '9' # Recent stable version
- 'latest' # Latest release
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version || '3.11' }}

- name: Install Ansible ${{ matrix.ansible-version }}
run: |
python -m pip install --upgrade pip
if [ "${{ matrix.ansible-version }}" = "latest" ]; then
pip install ansible docker
else
pip install "ansible~=${{ matrix.ansible-version }}.0" docker
fi

- name: Install Ansible collections
run: |
if [ "${{ matrix.ansible-version }}" = "5" ]; then
echo "Installing community.docker collection (workaround for Galaxy API issues with Ansible ${{ matrix.ansible-version }})"
ansible-galaxy collection install community.docker || echo "Collection install failed, but will continue with docker Python library"
else
ansible-galaxy collection install -r requirements.yml
fi

- name: Display Ansible version
run: ansible --version

- name: Setup test environment
run: |
printf '[defaults]\nroles_path=../' > ansible.cfg

- name: Run tests
run: make test-all

test-molecule:
name: Molecule Tests
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install molecule molecule-plugins[docker] ansible docker

- name: Run Molecule tests
run: |
molecule test
continue-on-error: true
working-directory: ${{ github.workspace }}

notify:
name: Notify Ansible Galaxy
runs-on: ubuntu-latest
needs: [test-integration]
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- name: Trigger galaxy import
run: |
echo "Would notify Ansible Galaxy here"
# curl -X POST https://galaxy.ansible.com/api/v1/notifications/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ansible.cfg
venv
venv-*
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
extends: default

rules:
line-length:
max: 160
level: warning
comments:
min-spaces-from-content: 1
comments-indentation: disable
document-start: disable
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
check-keys: false

ignore: |
.github/
.git/
venv/
venv-ansible-*/
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Comprehensive test suite with multiple test scenarios
- GitHub Actions CI/CD pipeline
- Molecule testing framework support
- Test runner script (`tests/run-tests.sh`)
- Linting configuration (yamllint, ansible-lint)
- CONTRIBUTING.md guide for contributors
- requirements.txt and requirements-dev.txt for development dependencies

### Changed
- Improved README with real-world examples from NAU project
- Enhanced documentation with better structure and formatting

### Removed
- Docker Swarm/Stack support (compose-only role now)
- Removed `docker_deploy_stack_template` variable
- Removed `docker_deploy_stack_name` variable
- Removed `docker_deploy_stack_pip_requirements` variable
- Removed `tasks/docker_deploy_stack.yml` task file

## [1.0.0] - Previous Release

### Added
- Initial support for Docker Compose deployments
- Docker Swarm/Stack deployment support
- File and template management
- Git repository cloning
- Docker configs and secrets support
- Health check functionality
- Custom deployment modes (shell vs Ansible module)

[Unreleased]: https://github.com/fccn/ansible-docker-deploy/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/fccn/ansible-docker-deploy/releases/tag/v1.0.0
Loading
Loading