-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit ccd5c30
Showing
42 changed files
with
2,431 additions
and
0 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,9 @@ | ||
exclude_paths: | ||
- .cache/ | ||
- meta/ | ||
- molecule/ | ||
- .tox | ||
skip_list: | ||
- '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern | ||
- experimental # all rules tagged as experimental | ||
- galaxy[no-changelog] |
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,32 @@ | ||
name-template: "v$RESOLVED_VERSION 🌈" | ||
tag-template: "v$RESOLVED_VERSION" | ||
categories: | ||
- title: "🚀 Features" | ||
labels: | ||
- "feature" | ||
- "enhancement" | ||
- title: "🐛 Bug Fixes" | ||
labels: | ||
- "fix" | ||
- "bugfix" | ||
- "bug" | ||
- title: "🧰 Maintenance" | ||
label: "chore" | ||
- title: "🧺 Miscellaneous" #Everything except ABAP | ||
label: "misc" | ||
change-template: "- $TITLE @$AUTHOR (#$NUMBER)" | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- "major" | ||
minor: | ||
labels: | ||
- "minor" | ||
patch: | ||
labels: | ||
- "patch" | ||
default: patch | ||
template: | | ||
## Changes | ||
$CHANGES |
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,77 @@ | ||
--- | ||
# This is a basic workflow to help you get started with Actions | ||
name: Molecule | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the master branch | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- master | ||
- tags/* | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
requirements: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: tcharl.ansible_routing | ||
- name: install prereq | ||
run: | | ||
cd tcharl.ansible_routing | ||
ansible-galaxy role install -r requirements-standalone.yml | ||
ansible-galaxy collection install -r requirements-collections.yml | ||
lint: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: tcharl.ansible_routing | ||
- name: update apt | ||
run: | | ||
sudo apt update | ||
- name: install aptitude packages | ||
run: | | ||
sudo apt -y install sudo python3 python3-pip | ||
- name: pip install packages | ||
run: | | ||
pip3 install wheel setuptools tox | ||
- name: tox lint | ||
run: | | ||
cd tcharl.ansible_routing | ||
tox -e lint | ||
test: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: tcharl.ansible_routing | ||
- name: update apt | ||
run: | | ||
sudo apt update | ||
# - name: apt upgrade | ||
# run: | | ||
# sudo apt upgrade | ||
- name: install aptitude packages | ||
run: | | ||
sudo apt -y install sudo python3 python3-pip podman | ||
- name: pip install packages | ||
run: | | ||
pip3 install wheel setuptools tox | ||
- name: Test with podman | ||
run: | | ||
cd tcharl.ansible_routing | ||
tox -e test-exec |
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,17 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,34 @@ | ||
--- | ||
name: Ansible Galaxy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
galaxy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Trigger a new import on Galaxy. | ||
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) |
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,5 @@ | ||
.idea | ||
**/__pychache__ | ||
.cache | ||
.tox | ||
build |
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,35 @@ | ||
--- | ||
# Based on ansible-lint config | ||
extends: default | ||
ignore: | | ||
.cache | ||
.tox | ||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
colons: | ||
max-spaces-after: -1 | ||
level: error | ||
commas: | ||
max-spaces-after: -1 | ||
level: error | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
empty-lines: | ||
max: 3 | ||
level: error | ||
hyphens: | ||
level: error | ||
indentation: disable | ||
key-duplicates: enable | ||
line-length: disable | ||
new-line-at-end-of-file: disable | ||
new-lines: | ||
type: unix | ||
trailing-spaces: disable | ||
truthy: disable |
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,13 @@ | ||
Copyright 2020 Charlie Mordant | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
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,57 @@ | ||
Routing | ||
========= | ||
|
||
* Galaxy: [![Ansible Galaxy](https://img.shields.io/badge/galaxy-tcharl.ansible_routing-660198.svg?style=flat)](https://galaxy.ansible.com/tcharl/ansible_routing) | ||
* Lint & Tests: ![Molecule](https://github.com/OsgiliathEnterprise/ansible-routing/workflows/Molecule/badge.svg) | ||
* Chat: [![Join the chat at https://gitter.im/OsgiliathEnterprise/platform](https://badges.gitter.im/OsgiliathEnterprise/platform.svg)](https://gitter.im/OsgiliathEnterprise/platform?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
|
||
This role let you configure simple port or port/IP redirections using firewalld masquerade | ||
|
||
Requirements | ||
------------ | ||
|
||
Ansible :-), but also some [collections](./requirements-collections.yml) and some [roles](./requirements.yml) | ||
|
||
Role Variables | ||
-------------- | ||
|
||
``` | ||
firewalld_zones: | ||
- name: public # optional | ||
nics: # optional, will take all the network interfaces of the machine by default | ||
- eth0 # optional | ||
masquerade: true | ||
port_forward_rules: | ||
- port_forward_rule: ssh-to-guest-ip | ||
family: ipv4 # optional | ||
from_port: 6752 | ||
protocol: tcp # optional | ||
to_address: 192.168.1.10 | ||
to_port: 22 | ||
- port_forward_rule: ssh-to-ansible-host-forward | ||
family: ipv4 # optional | ||
from_port: 6754 | ||
protocol: tcp # optional | ||
to_host: myhost.osgiliath.test | ||
to_port: 22 | ||
enabled_services: | ||
- service: ssh | ||
enabled_ports: | ||
- port: 6753 | ||
protocol: tcp | ||
enabled_port_ranges: | ||
- port_range: 6753-7000 | ||
protocol: tcp | ||
``` | ||
|
||
License | ||
------- | ||
|
||
[Apache-2](https://www.apache.org/licenses/LICENSE-2.0) | ||
|
||
Author Information | ||
------------------ | ||
|
||
* Twitter [@tcharl](https://twitter.com/Tcharl) | ||
* Github [@tcharl](https://github.com/Tcharl) | ||
* LinkedIn [Charlie Mordant](https://www.linkedin.com/in/charlie-mordant-51796a97/) |
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,5 @@ | ||
--- | ||
|
||
firewalld_become: true | ||
standalone_role: True | ||
firewalld_default_zone: public |
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,8 @@ | ||
<html> | ||
<head> | ||
<title>Example</title> | ||
</head> | ||
<body> | ||
<p>This is an example of a simple HTML page with one paragraph.</p> | ||
</body> | ||
</html> |
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 @@ | ||
client_max_body_size 0; | ||
chunked_transfer_encoding on; |
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,21 @@ | ||
--- | ||
namespace: "tcharl" | ||
name: "ansible_routing" | ||
version: "1.0.1" | ||
description: "Lets you configure simple port or port/IP redirections using firewalld masquerade" | ||
|
||
authors: | ||
- "Charlie Mordant <cmordant1@gmail.com>" | ||
|
||
repository: "https://github.com/OsgiliathEnterprise/ansible_routing" | ||
documentation: "https://github.com/OsgiliathEnterprise/ansible_routing/blob/master/README.md" | ||
homepage: "https://github.com/OsgiliathEnterprise/ansible_routing" | ||
issues: "https://github.com/OsgiliathEnterprise/ansible_routing/issues" | ||
|
||
readme: "README.md" | ||
license: | ||
- "Apache-2.0" | ||
tags: | ||
- "firewalld" | ||
- "rich-rules" | ||
- "linux" |
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,16 @@ | ||
--- | ||
# handlers file for ansible-routing | ||
|
||
- name: Handler | reload-firewall | ||
ansible.builtin.service: | ||
name: firewalld | ||
state: reloaded | ||
become: yes | ||
listen: ansible-routing | handler | reload-firewall | ||
|
||
- name: Handler | restart-firewall | ||
ansible.builtin.service: | ||
name: firewalld | ||
state: restarted | ||
become: yes | ||
listen: ansible-routing | restart | restart-firewall |
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 @@ | ||
install_date: Sat Aug 19 16:48:59 2023 | ||
version: v2.0.3 |
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 @@ | ||
if __name__ == "__main__": | ||
exit(0) |
Oops, something went wrong.