Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
e42e1d4
Sets 10 minutes by default for timeout
kenorb Sep 2, 2024
4bb0b3d
Add devcontainer configuration for Ansible role development
kenorb Mar 4, 2025
3e31d81
Add GitHub Copilot extensions to devcontainer configuration
kenorb Mar 4, 2025
cb2d9eb
Add Dependabot configuration for weekly devcontainer updates
kenorb Mar 4, 2025
e6ef0d0
Add .ansible to .gitignore
kenorb Mar 4, 2025
424610d
Fix indentation in Dependabot configuration for devcontainers
kenorb Mar 4, 2025
cefd0fc
Refactor devcontainer and Dependabot configuration for clarity and co…
kenorb Mar 4, 2025
b03ad7b
pre-commit update
kenorb Mar 4, 2025
7d2205f
Installs pip packages via requirements file
kenorb Mar 4, 2025
f6b5a17
Adds molecule/requirements.txt
kenorb Mar 4, 2025
33b0c7a
Refs #13. Probably fixes problem with Windows commands under Unix.
nseam Mar 4, 2025
b34a2e8
Adds newline at end of file
kenorb Mar 4, 2025
e533ca1
Sets wine_release to stable
kenorb Mar 5, 2025
eec1f42
Change stdout callback to default and set callback result format to yaml
kenorb Mar 6, 2025
52226fc
Updates molecule/requirements.txt
kenorb Mar 6, 2025
b34132f
Adds .png files to .gitignore [no-ci]
kenorb Mar 6, 2025
254ca82
Bump ea31337.metatrader version to v1.0.0 in all requirements files
kenorb Mar 6, 2025
b230707
Create .coderabbit.yaml
kenorb Mar 4, 2025
146d293
Adds missing document start "---"
kenorb Mar 6, 2025
abce5c9
Improves .yamllint [no-ci]
kenorb Mar 10, 2025
1fbcd50
Sets ea31337.metatrader to v1.0.1
kenorb Mar 10, 2025
2963423
Adds back line-length and truthy rules for .yamllint
kenorb Mar 10, 2025
cef7037
Adds vscode-github-actions extension
kenorb Mar 10, 2025
22a79ea
Update molecule workflow to enable debug mode conditionally on failure
kenorb Mar 11, 2025
f0b5218
Removes meta/requirements.txt [no-ci]
kenorb Mar 16, 2025
f17b975
Adds Pipfile and lock file [no-ci]
kenorb Mar 16, 2025
5d07ed3
Updates requirements file [no-ci]
kenorb Mar 16, 2025
4ce0f15
Removes redundant requirements files
kenorb Mar 16, 2025
e13a7a6
Updates requirements.txt
kenorb Mar 16, 2025
865c5fe
Updates Pipfile.lock [no-ci]
kenorb Mar 16, 2025
646f3d2
Adds .markdownlint.yaml
kenorb Mar 16, 2025
f9195ed
Ignores *.html files
kenorb Mar 16, 2025
b9fe519
Corrects copilot-instructions.md
kenorb Mar 16, 2025
43cd798
Updates devcontainer.json
kenorb Mar 16, 2025
9d2e3b7
Updates pre-commit/action to v3.0.1
kenorb Mar 17, 2025
4e5bb47
Improves molecule test report
kenorb Mar 17, 2025
edf8ee8
Adds paths-ignore for molecule workflow
kenorb Mar 17, 2025
1fe86e4
Improves molecule provisioner config options
kenorb Mar 17, 2025
c2cff72
Adds code-review.prompt.md [no-ci]
kenorb Mar 17, 2025
fd81463
Increases timeout to 120
kenorb Mar 17, 2025
4f11b5a
Sets metatrader to v1.0.1 version
kenorb Mar 17, 2025
c34606c
Sets oneline as default Ansible screen output [no-ci]
kenorb Mar 17, 2025
b96951e
Updates meta/main.yml
kenorb Apr 27, 2025
22443e8
Adds .ansible-lint
kenorb Apr 27, 2025
3e3eb9d
Improves .coderabbit.yaml
kenorb Apr 29, 2025
3814059
Minor changes
kenorb Apr 29, 2025
1da09c9
Adds ansible.cfg
kenorb May 8, 2025
26a8964
Adds tests
kenorb May 8, 2025
20eef9f
Enhances configuration and playbook for Docker containers, adds suppo…
kenorb May 8, 2025
0aad6dd
Adds rhysd/actionlint pre-commit repo
kenorb May 9, 2025
fbed1be
Adds .vscode/tasks.json
kenorb May 10, 2025
06bacec
Adds actionlint matcher configuration for enhanced linting support
kenorb May 10, 2025
be01b5c
Adds reviewdog workflow configuration for actionlint
kenorb May 10, 2025
daf3e14
Refines paths-ignore patterns in GitHub Actions workflow to exclude Y…
kenorb May 10, 2025
0c9e49c
Adds features/actionlint:
kenorb May 10, 2025
708a926
Refines paths-ignore patterns in Molecule workflow and updates ANSIBL…
kenorb May 10, 2025
4107d36
Refactors Docker container playbook to streamline Python installation…
kenorb May 10, 2025
c644ddb
Updates adrienverge/yamllint
kenorb May 10, 2025
b84bdd1
Updates pre-commit configuration to include additional hooks and upgr…
kenorb May 11, 2025
8cc497b
Enhances documentation and license information:
kenorb May 11, 2025
19bf270
Improves devcontainer configuration
kenorb May 11, 2025
c66d57d
Fixes typo in ignore_title_patterns and adds path instructions for YA…
kenorb May 11, 2025
5d555f5
Update documentation links in ansible.cfg and enhance comments in req…
kenorb May 11, 2025
b809386
Add Ansible linting rules and enhance YAML guidelines
kenorb May 11, 2025
7ac4a9e
Refine paths-ignore patterns in Molecule and Test workflows for consi…
kenorb May 11, 2025
8503a5e
Refactor converge.yml to streamline role inclusion and variable defin…
kenorb May 11, 2025
b26e0af
Refactor docker-containers.yml to improve container configuration and…
kenorb May 11, 2025
0ba0fc7
Update main.yml to enhance security by marking sensitive fields with …
kenorb May 12, 2025
d139036
To resolve the jinja-statements-delimiter lint errors, replace {%- an…
kenorb May 12, 2025
8cbcc2b
Update metatrader role version to v1.0.2 in requirements.yml
kenorb May 12, 2025
c86a597
Improves meta/main.yml
kenorb May 16, 2025
3431ea4
Improves README with installation steps using ansible-galaxy
kenorb May 16, 2025
9a2ef6c
Narrows down community.general version
kenorb May 16, 2025
32b804f
Removes confusing part in copilot-instructions.md
kenorb May 16, 2025
16a6ff6
Updates ea31337.metatrader role to v1.0.3
kenorb May 16, 2025
69fd2f1
Fix repository URL format in requirements.yml
kenorb May 16, 2025
ee2f8ba
Adds ansible-role-* to .gitignore
kenorb Jan 4, 2026
8a31a04
Various dev fixes
kenorb Jan 4, 2026
88f6d16
devcontainer.json: Code improvements
kenorb Jan 4, 2026
8ee46ab
Improves molecule prepare playbook and update provisioner settings
kenorb Jan 4, 2026
adbe0cc
Merges reviewdog workflow to check
kenorb Jan 4, 2026
8b94586
Enhances pre-commit configuration by adding black and flake8 hooks; r…
kenorb Jan 4, 2026
9f33395
Removes installing Python as it is already handled during image build
kenorb Jan 4, 2026
1f6007c
Fixes typo in ansible_host
kenorb Jan 4, 2026
43d39ab
Removes EOL Linux distributions from meta/main.yml
kenorb Jan 5, 2026
b5491c8
Minor fixes
kenorb Jan 5, 2026
80155bd
Sync changes across molecule.yml
kenorb Jan 5, 2026
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
20 changes: 20 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# .ansible-lint
exclude_paths:
- "*.yml.swp"
- .ansible/
- .cache/ # implicit unless exclude_paths is defined in config
# Ansible-lint does not automatically load rules that have the 'opt-in' tag.
# You must enable opt-in rules by listing each rule 'id' below.
enable_list:
- args
- empty-string-compare # opt-in
- no-log-password # opt-in
- no-same-owner # opt-in
# - name[prefix] # opt-in
# add yaml here if you want to avoid ignoring yaml checks when yamllint
# library is missing. Normally its absence just skips using that rule.
- yaml
mock_roles:
- community.docker.docker_image
verbosity: 0
3 changes: 2 additions & 1 deletion .ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ bin_ansible_callbacks = True
# Leave the 'cows' alone!
nocows = 1
# Use the YAML callback plugin.
stdout_callback = yaml
stdout_callback = default
callback_result_format = yaml

[diff]
# Always print diff when running (same as always running with -D/--diff).
Expand Down
50 changes: 50 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# CodeRabbit configuration
chat:
auto_reply: true
early_access: true
reviews:
auto_review:
base_branches:
- "dev*"
- "main"
- "master"
drafts: false
enabled: true
ignore_title_keywords:
- "WIP"
- "DO NOT MERGE"
high_level_summary: true
path_filters:
- "**/*.j2"
- "**/*.md"
- "**/*.py"
- "**/*.yaml"
- "**/*.yml"
- "defaults/**"
- "meta/**"
- "molecule/**"
- "tasks/**"
- "vars/**"
path_instructions:
- path: "**/*.yml"
instructions: |
- For Ansible files, review the YAML code against the Ansible best practices and point out any mismatches.
- Ensure keys are in lexicographical order when possible.
poem: true
request_changes_workflow: false
review_status: true
tools:
actionlint:
enabled: true
gitleaks:
enabled: true
hadolint:
enabled: true
markdownlint:
enabled: true
shellcheck:
enabled: true
yamllint:
enabled: true
version: 1
57 changes: 57 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{

// "build": {
// "dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
// "args": { "VARIANT": "ubuntu-22.04" }
// },

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"DavidAnson.vscode-markdownlint",
"GitHub.copilot",
"GitHub.copilot-chat",
"elagil.pre-commit-helper",
"formulahendry.code-runner",
"formulahendry.code-runner-copilot",
"github.vscode-github-actions",
"ms-python.python",
"vscodevim.vim"
],
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
// "ghcr.io/maks1ms/devcontainers-features/wine:0": {},
"ghcr.io/devcontainers-contrib/features/actionlint:1": {},
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {},
"ghcr.io/devcontainers-extra/features/pipx-package:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/guiyomh/features/vim:0": {},
"ghcr.io/jungaretti/features/make:1": {},
"ghcr.io/prulloac/devcontainer-features/pre-commit:1": {},
"ghcr.io/jungaretti/features/ripgrep:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"name": "ansible-role-mt-runner",
// Install dependencies and pre-commit hooks.
"postCreateCommand": "pip install -r .devcontainer/requirements.txt && pre-commit install",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"onCreateCommand": "sudo apt update && sudo apt install -y gh pipx && pipx install --include-deps ansible"
}
11 changes: 11 additions & 0 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Python's requirements
# Usage: pip install -r requirements.txt
ansible
ansible-lint
docker>=7.1
jinja2-cli
molecule
molecule-docker
pipenv
pre-commit
requests==2.31.0
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requests package is pinned to version 2.31.0, which has known security vulnerabilities (CVE-2023-32681). Consider updating to a newer version (2.32.0 or later) that addresses these security issues.

Suggested change
requests==2.31.0
requests==2.32.3

Copilot uses AI. Check for mistakes.
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
85 changes: 85 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copilot Instructions for ansible-role-mt-runner

You are expected to be an expert in:

- Ansible
- Python
- Jinja2
- Molecule
- Linux (Alpine, Debian/Ubuntu, Nix)
- YAML

## Code Standards

- Avoid writing trailing whitespace
- Follow PEP 8 for Python.
- Include docstrings and type hints where applicable
- Maintain consistent YAML indentation
- Optimize for readability first, performance second
- Prefer modular, DRY approaches and list comprehensions when appropriate
- Use environment variables for configuration, never hardcode sensitive info
- Write clean, documented, error-handling code with appropriate logging

## General Approach

- Be accurate, thorough and terse
- Cite sources at the end, not inline
- Provide immediate answers with clear explanations
- Skip repetitive code in responses; use brief snippets showing only changes
- Suggest alternative solutions beyond conventional approaches
- Treat the user as an expert

## Ansible Guidelines

- Ensure idempotency in all tasks
- Ensure indentation is correct, especially for YAML files
- Follow standard role structure: tasks/, handlers/, templates/, defaults/, meta/
- Use ansible-lint and write Molecule tests for verification
- Use descriptive task names and include helpful comments

## Ansible Linting

Ensure enforcing the following rules:

- fqcn[keyword]: Avoid `collections` keyword by using FQCN for all plugins, modules, roles and playbooks

## YAML Guidelines

Ensure the following rules are strictly followed:

- yaml[empty-lines]: Avoid too many blank lines
- yaml[indentation]: Avoid wrong indentation
- yaml[line-length]: No long lines (max. 120 characters)
- yaml[new-line-at-end-of-file]: Enforce new line character at the end of file
- yaml[truthy]: Truthy value should be one of [false, true]
- Ensure items are in lexicographical order when possible.
- When writing inline code, add a new line at the end to maintain proper indentation

## Project Specifics

This role installs and runs trading platform with distribution-specific approaches:

- **Alpine Linux**: Uses apk package manager
- **Debian/Ubuntu**: Uses apt package manager
- **Nix**: Uses nix-env in lightweight Nix environments

Notes:

- Project utilizes Codespaces with config file at .devcontainer/devcontainer.json
and requirements at .devcontainer/requirements.txt
- GitHub Actions are used to validate the code by running
pre-commit checks (see .pre-commit-config.yaml file) and Molecule (molecule/).
- Service management uses supervisord across platforms.
- Formatting rules are defined in .yamllint (YAML) and .markdownlint.yaml (Markdown) files.

### Key Variables

Variables are defined in defaults/main.yml and vars/main.yml files.

Notes:

- On variable changes, update main.yml and README.md files accordingly.

### Testing Approach

- Use Molecule with Docker driver
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot
---
version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
72 changes: 72 additions & 0 deletions .github/prompts/code-review.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Ansible Role Code Review Guidelines

Your goal is to review Ansible role code
to ensure it meets high-quality standards and follows best practices.

## Ensure Code Quality

- Follow PEP 8 for Python.
- Maintain consistent YAML indentation.
- Optimize for readability first, performance second.
- Ensure idempotency in all Ansible tasks.
- Use environment variables for configuration, never hardcode sensitive info.
- Write clean, documented, error-handling code with appropriate logging.

## Check for Linting and Formatting

- Ensure YAML files adhere to [.yamllint](../../.yamllint) rules.
- Ensure Markdown files adhere to [.markdownlint.yaml](../../.markdownlint.yaml) rules.
- Ensure Ansible playbooks and roles pass `ansible-lint`.

## Review Ansible Role Structure

- Follow standard role structure:

- [tasks/](../../tasks/)
- [handlers/](../../handlers/)
- [templates/](../../templates/)
- [defaults/](../../defaults/)
- [meta/](../../meta/)

- Use descriptive task names and include helpful comments.
- Ensure indentation is correct, especially for arguments used for Ansible modules.

## Verify Variables and Defaults

- Ensure variables are defined in
[defaults/main.yml](../../defaults/main.yml) and [vars/main.yml](../../vars/main.yml).
- Update [README.md](../../README.md) with any changes to variables.
- Ensure variables are used consistently across tasks and playbooks.

## Check for Idempotency

- Ensure all tasks are idempotent and do not cause unnecessary changes on repeated runs.

## Review Molecule Tests

- Ensure Molecule scenarios are defined and cover all supported platforms.
- Verify that Molecule tests are comprehensive and validate the role's functionality.
- Check [molecule/](../../molecule/) directory for test configurations.

## Ensure Proper Error Handling

- Write error-handling code with appropriate logging.
- Ensure tasks fail gracefully and provide meaningful error messages.

## Check for Dependencies

- Ensure all dependencies are listed in
[.devcontainer/requirements.txt](../../.devcontainer/requirements.txt) and [requirements.yml](../../requirements.yml).
- Verify that the role does not have any missing dependencies.

## Review GitHub Actions

- Ensure GitHub Actions workflows are correctly configured to run pre-commit checks and Molecule tests.
- Verify that the workflows cover all necessary validation steps.
- Check [.github/workflows/](../) directory for workflow configurations.

## Documentation

- Ensure the [README.md](../../README.md) file is up-to-date
and provides clear instructions for installation, usage, and variables.
- Include any additional documentation as needed for clarity.
15 changes: 13 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ on:
push:

jobs:
Pre-commit:
actionlint:
name: actionlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1
- name: Add Problem Matcher for actionlint
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
shell: bash
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -16,4 +27,4 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.0
- uses: pre-commit/action@v3.0.1
Loading
Loading