Skip to content

Commit

Permalink
update ansible version
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcharl committed Dec 22, 2023
0 parents commit 49e6f42
Show file tree
Hide file tree
Showing 37 changed files with 2,167 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
exclude_paths:
- .cache/
- .tox/
- tests
- meta/
- molecule/
- .github/
skip_list:
- experimental # all rules tagged as experimental
- '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern
- galaxy[no-changelog] # Role {} should have a changelog file
32 changes: 32 additions & 0 deletions .github/release-drafter.yml
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
52 changes: 52 additions & 0 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# 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.etchost_append
- name: install prereq
run: |
cd tcharl.etchost_append
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.etchost_append
- 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.etchost_append
tox -e lint
17 changes: 17 additions & 0 deletions .github/workflows/release-drafter.yml
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 }}
34 changes: 34 additions & 0 deletions .github/workflows/release-galaxy.yml
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@v2
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)
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
**/*__pychache__*
.cache
build
.tox
molecule/default/tests/__pycache__
molecule/kvm/tests/__pycache__
43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

dist: focal

language: python
python:
- "3.11"

addons:
apt:
sources:
- sourceline: 'deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main'
key_url: 'https://apt.releases.hashicorp.com/gpg'
update: true
packages:
- bridge-utils
- dnsmasq-base
- ebtables
- virtinst
- libvirt-dev
- libvirt-daemon-system
- qemu-kvm
- qemu-utils
- ruby-dev
- ca-certificates
- curl
- gcc
- iproute2
- sudo
- vagrant

install:
- vagrant plugin install vagrant-libvirt
- pip install wheel pyopenssl tox
- sudo chmod o+rwx /var/run/libvirt/libvirt-sock

script:
- mv ../etchost_append ../tcharl.etchost_append
- cd ../tcharl.etchost_append
- travis_wait 60 tox -e test-exec -- --scenario-name kvm
branches:
only:
- master
35 changes: 35 additions & 0 deletions .yamllint
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
13 changes: 13 additions & 0 deletions LICENSE.md
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.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Ansible Etchost_append
=========

* Galaxy: [![Ansible Galaxy](https://img.shields.io/badge/galaxy-tcharl.etchost_append-660198.svg?style=flat)](https://galaxy.ansible.com/tcharl/etchost_append)
* Lint & requirements: ![Molecule](https://github.com/OsgiliathEnterprise/etchost_append/workflows/Molecule/badge.svg)
* Tests: ![Travis](https://app.travis-ci.com/OsgiliathEnterprise/etchost_append.svg?branch=master)
* 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)

Appends entries in /etc/hosts file

Requirements
------------

Like any other platform role, executing `tox -e pipdep` and `tox -e dependency`

Role Variables
--------------

Take a look at the [molecule tests](./molecule/default/converge.yml) tests and the [default variables](./defaults/main.yml)

Dependencies
------------

See [requirements collections](./requirements-collections.yml) and [requirements standalone](./requirements-standalone.yml)

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/)
21 changes: 21 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
namespace: "tcharl"
name: "etchost_append"
version: "2.0.1"
description: "Appends entries in etc/hosts file"

authors:
- "Charlie Mordant <cmordant1@gmail.com>"

repository: "https://github.com/OsgiliathEnterprise/etchost_append"
documentation: "https://github.com/OsgiliathEnterprise/etchost_append/blob/master/README.md"
homepage: "https://github.com/OsgiliathEnterprise/etchost_append"
issues: "https://github.com/OsgiliathEnterprise/etchost_append/issues"

readme: "README.md"
license:
- "Apache-2.0"
tags:
- "etchost"
- "host-entries"
- "linux"
2 changes: 2 additions & 0 deletions meta/.galaxy_install_info
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install_date: Sat Aug 19 16:50:05 2023
version: v2.0.2
2 changes: 2 additions & 0 deletions meta/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
if __name__ == "__main__":
exit(0)
55 changes: 55 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
galaxy_info:
role_name: etchost_append
author: OsgiliathEnterprise
description: Append entries in /etc/host file
company: Osgiliath
namespace: tcharl
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: Apache-2.0

min_ansible_version: 2.9

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: Fedora
versions:
- 33
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99

galaxy_tags:
- "freeipa-server"
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
requires_ansible: ">= 2.11.0" # Use '>= 2.9.10' instead, if needed
13 changes: 13 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Converge
hosts: all
vars:
hosts_entries:
- name: idm.osgiliath.test
ip: 192.168.122.1
- name: infra.osgiliath.test
ip: 192.168.122.2
- name: poc.osgiliath.test
ip: 192.168.122.2
roles:
- role: tcharl.etchost_append
Loading

0 comments on commit 49e6f42

Please # to comment.