Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes on molecule v4 tests and latest galaxy meta compatibility #27

Merged
merged 4 commits into from
Jun 19, 2022
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
51 changes: 29 additions & 22 deletions .github/workflows/galaxy-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,52 @@ jobs:
matrix:
# Better to use one scenario per OS for faster performance and easier debugging
scenario:
# - centos-8
- centos-8
- ubuntu-2004
steps:

- name: Checkout
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"

- name: Molecule converge
uses: gofrolist/molecule-action@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: converge
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
python-version: '3.x'

- name: Install dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install yamllint ansible-lint ansible "molecule[lint,docker]"

- name: Install Galaxy dependencies.
run: ansible-galaxy collection install community.docker

- name: check molecule version
run: molecule --version

- name: Run molecule converge
run: "molecule converge --scenario-name ${{ matrix.scenario }}"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule syntax
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: syntax
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
working-directory: "${{ github.repository }}"

- name: Run molecule syntax
run: "molecule syntax --scenario-name ${{ matrix.scenario }}"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule idempotence
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: idempotence
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
working-directory: "${{ github.repository }}"

- name: Run molecule idempotence
run: "molecule idempotence --scenario-name ${{ matrix.scenario }}"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
working-directory: "${{ github.repository }}"


# https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
# Don't forget to add the secret galaxy_api_key in your repository
Expand Down
51 changes: 29 additions & 22 deletions .github/workflows/molecule-test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# https://thedatabaseme.de/2022/01/17/automated-testing-your-ansible-role-with-molecule-and-github-actions/

name: Molecule pipeline test

on:
Expand All @@ -19,41 +21,46 @@ jobs:
scenario:
- centos-8
- ubuntu-2004
- stable-ubuntu-1804
steps:

- name: Checkout
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"

- name: Molecule converge
uses: gofrolist/molecule-action@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: converge
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
python-version: '3.x'

- name: Install dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install yamllint ansible-lint ansible "molecule[lint,docker]"

- name: Install Galaxy dependencies.
run: ansible-galaxy collection install community.docker

- name: check molecule version
run: molecule --version

- name: Run molecule converge
run: "molecule converge --scenario-name ${{ matrix.scenario }}"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule syntax
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: syntax
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
working-directory: "${{ github.repository }}"

- name: Run molecule syntax
run: "molecule syntax --scenario-name ${{ matrix.scenario }}"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule idempotence
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: idempotence
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
working-directory: "${{ github.repository }}"

- name: Run molecule idempotence
run: "molecule idempotence --scenario-name ${{ matrix.scenario }}"
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
working-directory: "${{ github.repository }}"
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.1.0:
* Fixes on molecule v4 tests and latest galaxy meta compatibility

2.0.0:
* Remove python2 support
* Update tests to github actions
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
galaxy_info:
author: "coffeeitworks"
company: coffeeITWorks
role_name: ansible_burpui_server
description: ansible role to deploy and maintain burpui with all its options

# If the issue tracker for your role is not on github, uncomment the
Expand Down
9 changes: 5 additions & 4 deletions molecule/centos-8/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
burpui_standalone: True
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui'
burpui_use_dev: True
roles:
# - role: coffeeitworks.burp2_server
- role: ansible_burpui_server
tasks:
- name: Include ansible_burpui_server
include_role:
name: ansible_burpui_server
tags:
- burpui-server
- burpui-server
9 changes: 5 additions & 4 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
burpui_standalone: True
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui'
burpui_use_dev: True
roles:
- role: coffeeitworks.burp2_server
- role: ansible_burpui_server
tasks:
- name: Include ansible_burpui_server
include_role:
name: ansible_burpui_server
tags:
- burpui-server
- burpui-server
15 changes: 0 additions & 15 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ platforms:
groups:
- use_pip_package

- name: ansible_burpui_server-04
image: "geerlingguy/docker-centos8-ansible"
command: /sbin/init
privileged: True
pre_build_image: true
capabilities:
- SYS_ADMIN
tmpfs:
- /run
- /tmp
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
groups:
- use_pip_package

provisioner:
name: ansible
config_options:
Expand Down
9 changes: 5 additions & 4 deletions molecule/local-stable/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
vars:
burpui_standalone: True
burpui_use_dev: False
roles:
# - role: coffeeitworks.burp2_server
- role: ansible_burpui_server
tasks:
- name: Include ansible_burpui_server
include_role:
name: ansible_burpui_server
tags:
- burpui-server
- burpui-server
9 changes: 5 additions & 4 deletions molecule/local/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
burpui_standalone: True
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui'
burpui_use_dev: True
roles:
# - role: coffeeitworks.burp2_server
- role: ansible_burpui_server
tasks:
- name: Include ansible_burpui_server
include_role:
name: ansible_burpui_server
tags:
- burpui-server
- burpui-server
15 changes: 0 additions & 15 deletions molecule/local/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ platforms:
groups:
- group1

- name: ansible_burpui_server-04
image: "geerlingguy/docker-centos8-ansible"
command: /usr/sbin/init
#privileged: True
pre_build_image: true
capabilities:
- SYS_ADMIN
tmpfs:
- /run
- /tmp
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
groups:
- use_pip_package

provisioner:
name: ansible
config_options:
Expand Down
12 changes: 0 additions & 12 deletions molecule/stable-ubuntu-1804/converge.yml

This file was deleted.

34 changes: 0 additions & 34 deletions molecule/stable-ubuntu-1804/molecule.yml

This file was deleted.

9 changes: 0 additions & 9 deletions molecule/stable-ubuntu-1804/verify.yml

This file was deleted.

7 changes: 4 additions & 3 deletions molecule/ubuntu-2004/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
burpui_standalone: True
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui'
burpui_use_dev: True
roles:
# - role: coffeeitworks.burp2_server
- role: ansible_burpui_server
tasks:
- name: Include ansible_burpui_server
include_role:
name: ansible_burpui_server
tags:
- burpui-server