-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5d088d
commit b78d0d8
Showing
28 changed files
with
1,579 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file contains ignores rule violations for ansible-lint | ||
meta/main.yml schema[meta] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
--- | ||
name: Lint | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
|
||
defaults: | ||
|
||
run: | ||
working-directory: 'nephelaiio.rabbitmq' | ||
working-directory: 'nephelaiio.mongos' | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
|
||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
- name: Check out the codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
path: 'nephelaiio.rabbitmq' | ||
path: 'nephelaiio.mongos' | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
- name: Set up python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install yamllint ansible-lint | ||
- name: Update ubuntu repositories | ||
run: sudo apt-get update | ||
|
||
- name: Install make | ||
run: sudo apt-get install -y make | ||
|
||
- name: Lint code. | ||
run: | | ||
yamllint . | ||
ansible-lint . | ||
- name: Lint code | ||
run: make lint |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
name: molecule | ||
|
||
on: | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: "0 5 * * 5" | ||
|
||
defaults: | ||
|
||
run: | ||
working-directory: 'nephelaiio.mongos' | ||
|
||
jobs: | ||
|
||
molecule: | ||
|
||
name: molecule | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
scenario: | ||
- name: default | ||
image: | ||
- name: ubuntu2204 | ||
command: /lib/systemd/systemd | ||
- name: ubuntu2004 | ||
command: /lib/systemd/systemd | ||
- name: debian12 | ||
command: /lib/systemd/systemd | ||
- name: debian11 | ||
command: /lib/systemd/systemd | ||
steps: | ||
- name: Check out the codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
path: 'nephelaiio.mongos' | ||
|
||
- name: Set up python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Update ubuntu repositories | ||
run: sudo apt-get update | ||
|
||
- name: Install make | ||
run: sudo apt-get install -y make | ||
|
||
- name: Install dependencies | ||
run: make install | ||
|
||
- name: Debug test environment | ||
run: make debug | ||
|
||
- name: Run molecule tests. | ||
run: make test | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
MOLECULE_DOCKER_IMAGE: ${{ matrix.image.name }} | ||
MOLECULE_DOCKER_COMMAND: ${{ matrix.image.command }} | ||
MOLECULE_SCENARIO: ${{ matrix.scenario.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fileignoreconfig: | ||
- filename: poetry.lock | ||
ignore_detectors: [filecontent] | ||
- filename: .github/workflows/release.yml | ||
ignore_detectors: [filecontent] | ||
- filename: molecule/default/molecule.yml | ||
ignore_detectors: [filecontent] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.PHONY: all ${MAKECMDGOALS} | ||
|
||
MOLECULE_SCENARIO ?= default | ||
MOLECULE_DOCKER_IMAGE ?= ubuntu2204 | ||
GALAXY_API_KEY ?= | ||
GITHUB_REPOSITORY ?= $$(git config --get remote.origin.url | cut -d: -f 2 | cut -d. -f 1) | ||
GITHUB_ORG = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 1) | ||
GITHUB_REPO = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 2) | ||
REQUIREMENTS = requirements.yml | ||
|
||
all: install version lint test | ||
|
||
install: | ||
@type poetry >/dev/null || pip3 install poetry | ||
@poetry install | ||
|
||
lint: install | ||
poetry run yamllint . | ||
poetry run ansible-lint . | ||
poetry run molecule syntax | ||
|
||
roles: | ||
[ -f ${REQUIREMENTS} ] && yq '.$@[] | .name' -r < ${REQUIREMENTS} \ | ||
| xargs -L1 poetry run ansible-galaxy role install --force || exit 0 | ||
|
||
collections: | ||
[ -f ${REQUIREMENTS} ] && yq '.$@[]' -r < ${REQUIREMENTS} \ | ||
| xargs -L1 echo poetry run ansible-galaxy -vvv collection install --force || exit 0 | ||
|
||
requirements: roles collections | ||
|
||
dependency create prepare converge idempotence side-effect verify destroy login reset: | ||
MOLECULE_DOCKER_IMAGE=${MOLECULE_DOCKER_IMAGE} poetry run molecule $@ -s ${MOLECULE_SCENARIO} | ||
|
||
ignore: | ||
poetry run ansible-lint --generate-ignore | ||
|
||
clean: destroy reset | ||
@poetry env remove $$(which python) >/dev/null 2>&1 || exit 0 | ||
|
||
publish: | ||
@echo publishing repository ${GITHUB_REPOSITORY} | ||
@echo GITHUB_ORGANIZATION=${GITHUB_ORG} | ||
@echo GITHUB_REPOSITORY=${GITHUB_REPO} | ||
@poetry run ansible-galaxy role import \ | ||
--api-key ${GALAXY_API_KEY} ${GITHUB_ORG} ${GITHUB_REPO} | ||
|
||
version: | ||
@poetry run molecule --version | ||
|
||
debug: version | ||
@poetry export --dev --without-hashes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,14 @@ | ||
--- | ||
# rabbitmq_packages: | ||
|
||
rabbitmq_packages_state: present | ||
|
||
# rabbitmq_service_names: | ||
|
||
rabbitmq_service_status: started | ||
|
||
rabbitmq_service_enabled: yes | ||
|
||
# rabbitmq_package: | ||
# rabbitmq_service_name: | ||
# rabbitmq_vhost: '' | ||
|
||
# rabbitmq_user_name: '' | ||
|
||
rabbitmq_package_state: present | ||
rabbitmq_service_status: started | ||
rabbitmq_service_enabled: true | ||
rabbitmq_user_pass: '' | ||
|
||
rabbitmq_user_perm_conf: '.*' | ||
|
||
rabbitmq_user_perm_write: '.*' | ||
|
||
rabbitmq_user_perm_read: '.*' | ||
|
||
rabbitmq_user_tags: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
--- | ||
- name: remove default vhost | ||
command: rabbitmqctl delete_vhost / | ||
when: | ||
- rabbitmq_vhost is defined | ||
- name: Remove default vhost | ||
ansible.builtin.command: rabbitmqctl delete_vhost / | ||
listen: vhost_remove | ||
when: rabbitmq_vhost is defined | ||
changed_when: true | ||
|
||
- name: remove guest user | ||
command: rabbitmqctl delete_user guest | ||
when: "'guest' in rabbitmq_users.stdout" | ||
- name: Remove guest user | ||
ansible.builtin.command: rabbitmqctl delete_user guest | ||
listen: guest_remove | ||
vars: | ||
_output: guest | ||
when: _output in rabbitmq_users.stdout | ||
changed_when: true |
Oops, something went wrong.