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 21, 2023
0 parents commit cb0546c
Show file tree
Hide file tree
Showing 44 changed files with 2,468 additions and 0 deletions.
1 change: 1 addition & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-P ubuntu-latest=nektos/act-environments-ubuntu:18.04
7 changes: 7 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude_paths:
- .cache/
- meta/
- molecule/
- .tox/
skip_list:
- '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern
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.ansible_volumes
- name: install prereq
run: |
cd tcharl.ansible_volumes
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_volumes
- 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_volumes
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)
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
**/*/__pycache__
.cache
.tox
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

dist: jammy

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 ../ansible-volumes ../tcharl.ansible_volumes
- travis_wait 30 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.
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Volumes
=========

* Galaxy: [![Ansible Galaxy](https://img.shields.io/badge/galaxy-tcharl.ansible_volumes-660198.svg?style=flat)](https://galaxy.ansible.com/tcharl/ansible_volumes)
* Lint & requirements: ![Molecule](https://github.com/OsgiliathEnterprise/ansible-volumes/workflows/Molecule/badge.svg)
* Tests: [![Build Status](https://travis-ci.com/OsgiliathEnterprise/ansible-volumes.svg?branch=master)](https://travis-ci.com/OsgiliathEnterprise/ansible-volumes)
* 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 is an extension of the [most used lvm cookbook](https://github.com/mrlesmithjr/ansible-manage-lvm).
It add the ability to create thinpools and their associated metadata

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

In addition to the [usual variables](https://github.com/mrlesmithjr/ansible-manage-lvm/blob/master/README.md), you can declare some more in order to configure thinpools

```yaml
---
lvmetanames:
...
metadata: <another lvname> # declares the metadata logical volume
```
```yaml
---
lvmetanames:
...
autoextendtreshold: <number> # threshold of the autoextend profile
autoextendpercent: <number> # percentage of the autoextend profile
```
Full example
```yaml
---
vars:
lvm_groups:
- vgname: myvg
disks:
- /dev/sdb1
create: true
lvnames:
- lvname: notathinpool # original role
size: 40%VG
opts: ""
create: true
filesystem: xfs
mntp: /var/stuff
mount: true
lvmetanames:
- lvname: thinpool
size: 40%VG
opts: "--wipesignatures y"
create: true
metadata: myvg/thinpoolmeta
autoextendtreshold: 80
autoextendpercent: 20
filesystem: xfs
mntp: /var/lib/docker
mount: true
- lvname: thinpoolmeta
size: 10%VG
opts: "--wipesignatures y"
create: true
manage_lvm: true
```
Also configures NFS server, but only if the machine is protected by Kerberos (see tcharl.ansible_securehost in order to configure it)
Dependencies
------------
As said, [mrlesmithjr.ansible-manage-lvm](https://github.com/mrlesmithjr/ansible-manage-lvm)
Example Playbook
----------------
See the [vars declared](https://github.com/OsgiliathEnterprise/ansible-volumes/blob/master/molecule/default/molecule.yml) on the molecule test, as well as [their impact](https://github.com/OsgiliathEnterprise/ansible-manage-lvm-plus/blob/master/molecule/default/tests/test_default.py)
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/)
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# defaults file for lvm

standalone_role: True
secure_logs: Yes
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: "ansible_volumes"
version: "1.0.1"
description: "Manipulates volume groups and logical volumes"

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

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

readme: "README.md"
license:
- "Apache-2.0"
tags:
- "volumes"
- "volume-groups"
- "logical-volumes"
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:48:21 2023
version: v2.0.1
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)
Loading

0 comments on commit cb0546c

Please # to comment.