Skip to content

Commit

Permalink
[~] Migrate componets into default values (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
shellshock1953 authored Dec 17, 2023
1 parent f0aa4d8 commit 16d8873
Show file tree
Hide file tree
Showing 41 changed files with 1,015 additions and 664 deletions.
1 change: 0 additions & 1 deletion .cache/roles/components

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Deploy Collection

on:
release:
types:
- published

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Get the version name from the tags
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Injecting a dynamic Collection version
uses: artis3n/ansible_galaxy_collection@v2
with:
api_key: '${{ secrets.GALAXY_API_KEY }}'
galaxy_version: '${{ env.RELEASE_VERSION }}'
33 changes: 33 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Molecule
on:
push:
paths:
- 'defaults/**'
- 'tasks/**'
- 'molecule/**'
- 'templates/**'
pull_request:
branches: [master]
paths:
- 'defaults/**'
- 'tasks/**'
- 'molecule/**'
- 'templates/**'
jobs:
tests:
runs-on: ubuntu-latest
name: unittests
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{ github.repository }}
- name: Molecule
uses: gofrolist/molecule-action@v2
with:
molecule_command: test
molecule_args: -d docker
molecule_working_dir: dnullproject/components
env:
ANSIBLE_FORCE_COLOR: '1'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
filter_plugins/__pycache__/
.cache/
*component_rendered_tasks*
10 changes: 10 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
# Default state for all rules
default: true
# MD013/line-length - Line length
MD013:
line_length: 140
tables: false
MD041: false
MD025: false
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: [--baseline, .secrets.baseline]
# - repo: https://github.com/lyz-code/yamlfix/
# rev: 1.11.0
# hooks:
# - id: yamlfix
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.29.0
hooks:
- id: yamllint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: pretty-format-json
args: [--autofix]
- id: trailing-whitespace
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint-fix
args: [--fix]
112 changes: 112 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"version": "1.4.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"generated_at": "2023-12-17T19:18:20Z"
}
32 changes: 32 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# Based on ansible-lint config
extends: default
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
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Changelog

## 2023-06-??

### Version: 2.0

#### DEPRECATED

- `templates:` and it vars moved from top, level into
`role_component.<component_name>.[config|run_config].template`,
and now look like this:

```yaml

role_component:
git:
configs:
templates:
gitconfig:
template: "gitconfig"
dest: "~/.gitconfig"
variables:
foo: bar
```
- `zip-configs` deleted

#### Changed

- component vars moved from playbook vars, into role defaults.
Now, you can find them in [./defaults/main](./defaults/main)
- refactored ansible messaged. Now they look like:
`[component][<name>][<task>]`
- reduced number of debug messages

#### Added

- install via Brew package manager:
`role_component.<component_name>.install.brew=[]`
- for macOS all
`role_component.<component_name>.install.packages=[]`
will be installed viw Brew
- conditional `become`
`role_component.<component_name>.install.become=[True|False]`
- molecule tests

---

## 2022-03-05

### Version: 1.0

#### Basics

What works:

- install, pre, post
- config, pre, post
- run_config, pre, post
- run - only basics

What need to be upgraded:

- run - more options
- handlers - in config, run, across all pre and post
File renamed without changes.
Loading

0 comments on commit 16d8873

Please sign in to comment.