Skip to content

Commit

Permalink
Fix ansible-lint reported issues (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Jan 8, 2023
1 parent 822e085 commit 5e24f71
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude_paths:
- changelogs
18 changes: 8 additions & 10 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ jobs:
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html

sanity:
name: Sanity (${{ matrix.ansible }})
name: Sanity (${{ matrix.ansible }})
strategy:
matrix:
ansible:
# It's important that Sanity is tested against all stable-X.Y branches
# Testing against `devel` may fail as new tests are added.
# - stable-2.9 # Only if your collection supports Ansible 2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
- devel
runs-on: ubuntu-latest
steps:
Expand All @@ -35,19 +33,19 @@ jobs:
# .../ansible_collections/community/molecule/

- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ansible_collections/community/molecule

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
# it is just required to run that once as "ansible-test sanity" in the docker image
# will run on all python versions it supports.
python-version: 3.8
python-version: 3.9

# Install the head of the given branch (devel, stable-2.10)
- name: Install ansible-base (${{ matrix.ansible }})
- name: Install ansible (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check

# run ansible-test sanity inside of Docker.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags: # any tag regardless of its name, no branches
push: # only publishes pushes to the main branch to TestPyPI
branches: # any integration branch but not tag
- "master"
- "main"
tags-ignore:
- "**"
pull_request:
Expand All @@ -23,7 +23,7 @@ jobs:
- tox_env: lint

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Find python version
id: py_ver
shell: python
Expand Down
3 changes: 2 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ readme: README.md
authors:
- Sorin Sbarnea (github/ssbarnea)
description: Ansible Molecule collection contains molecule specific plugins.
license: MIT
license:
- MIT
tags:
- molecule
- testing
Expand Down
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
requires_ansible: '>=2.9.10'
requires_ansible: '>=2.12.0'
15 changes: 7 additions & 8 deletions playbooks/validate.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
- hosts: localhost
- name: Validate filter
hosts: localhost
gather_facts: false
collections:
- community.molecule
tasks:

- name: Check if community.molecule.header filter can be used
debug:
ansible.builtin.debug:
msg: "{{ '' | community.molecule.header }}"

- name: Test community.molecule.header filter result
set_fact:
ansible.builtin.set_fact:
with_header: "{{ '# This is test content\n' | community.molecule.header }}"

- name: Assert community.molecule.header filter result
assert:
ansible.builtin.assert:
that:
- "'# Molecule managed\n\n# This is test content\n' == with_header"

- name: Check if community.molecule.to_yaml filter can be used
debug:
ansible.builtin.debug:
msg: "{{ '' | community.molecule.to_yaml }}"

- name: Check if community.molecule.from_yaml filter can be used
debug:
ansible.builtin.debug:
msg: "{{ '' | community.molecule.from_yaml }}"

0 comments on commit 5e24f71

Please sign in to comment.