Browse Source

[UPD] Latest cookies

Signed-off-by: Justin Lecher <justin@jlec.de>
master
Justin Lecher 2 days ago
parent
commit
f47793d7b2
  1. 2
      .cruft.json
  2. 2
      .gitignore
  3. 36
      Makefile
  4. 8
      Pipfile
  5. 29
      roles/nomad/.cruft.json
  6. 32
      roles/nomad/Makefile
  7. 9
      roles/nomad/meta/main.yml
  8. 2
      roles/nomad/molecule/default/converge.yml
  9. 2
      roles/nomad/tests/test.yml

2
.cruft.json

@ -1,6 +1,6 @@
{
"template": "git@git.ercpe.de:justin/cookiecutter-ansible-collection.git",
"commit": "16d60899abcb974ffbf47b92d300236393cb5d58",
"commit": "0db7230f43a8165f388703f4d8c3420f46c260a8",
"context": {
"cookiecutter": {
"full_name": "Justin Lecher",

2
.gitignore

@ -29,5 +29,3 @@ packer_cache/
pytestdebug.log
setup*done
tmp
pytestdebug.log

36
Makefile

@ -1,6 +1,7 @@
ROLES := $(wildcard roles/*/.)
PIPENV := pipenv run
PYTESTARGS ?= -x -vvl
BLACKARGS := --line-length 128 --check --diff
.PHONY: help
@ -54,20 +55,30 @@ publish:
git push -v --progress
git push -v --progress --tags
################################################################################
#
# Cookies options
#
################################################################################
.PHONY: cruft-update
cruft-update: setup-dev.done
git stash
$(PIPENV) cruft update --allow-untracked-files
git stash pop
################################################################################
#
# Checking and Linting
#
################################################################################
.PHONY: ansible-lint black check cruft-check lint linting pytest test
.PHONY: check cruft-check pre-commit lint linting test $(ROLES)
check: cruft-check lint test
check: cruft-check lint
cruft-check: setup-dev.done
$(PIPENV) cruft check
$(PIPENV) cruft diff --exit-code
test: $(ROLES)
$(PIPENV) cruft diff
pre-commit: setup-dev.done
$(PIPENV) pre-commit run --all-files
@ -75,20 +86,17 @@ pre-commit: setup-dev.done
lint: linting
linting: pre-commit
test: $(ROLES)
$(ROLES):
$(MAKE) -C $@ test
################################################################################
#
# Custom options
#
################################################################################
.PHONY: clean cruft-update $(ROLES)
cruft-update: setup-dev.done
git stash
$(PIPENV) cruft update --allow-untracked-files
git stash pop
$(ROLES):
$(MAKE) -C $@ test
.PHONY: clean
clean:
rm -rvf tmp setup*done

8
Pipfile

@ -7,12 +7,16 @@ verify_ssl = true
ansible = "*"
ansible-lint = "*"
black = "*"
cruft = "*"
bumpversion = "*"
cruft = "*"
molecule = {extras = [ "ansible", "docker", "lint" ], version = "*"}
pre-commit = "*"
pytest = "*"
PyYAML = "*"
pytest = "<6"
pytest-cookies = "*"
pytest-parallel = "*"
pytest-testinfra = "*"
pytest-xdist = "<2"
yamllint = "*"
[packages]

29
roles/nomad/.cruft.json

@ -1,16 +1,17 @@
{
"template": "git@git.ercpe.de:justin/cookiecutter-ansible-role.git",
"commit": "a671e38c6a10336aea815ac2654c339f5d9123b7",
"context": {
"cookiecutter": {
"full_name": "Justin Lecher",
"email": "justin@jlec.de",
"ansible_namespace": "jlec",
"ansible_collection": "hashicorp",
"role_name": "nomad",
"role_short_description": "Install and Configure HashiCorps nomad",
"_template": "git@git.ercpe.de:justin/cookiecutter-ansible-role.git"
}
},
"directory": null
"template": "git@git.ercpe.de:justin/cookiecutter-ansible-role.git",
"commit": "56f6e09c950a09b629086ddabb74d427b655f7a0",
"context": {
"cookiecutter": {
"full_name": "Justin Lecher",
"email": "justin@jlec.de",
"ansible_namespace": "jlec",
"ansible_collection": "hashicorp",
"role_name": "nomad",
"role_short_description": "Install and Configure HashiCorps nomad",
"_template": "git@git.ercpe.de:justin/cookiecutter-ansible-role.git"
}
},
"directory": null,
"checkout": null
}

32
roles/nomad/Makefile

@ -1,21 +1,44 @@
MOLECULE_ARGS ?= --verbose
MOLECULE = pipenv run molecule ${MOLECULE_ARGS}
PIPENV := pipenv run
PYTESTARGS ?= -x -vvl
.PHONY: help check
.PHONY: help
help:
@echo "Make targets:\n"
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
################################################################################
#
# Cookies options
#
################################################################################
.PHONY: cruft-update
cruft-update:
git stash
$(PIPENV) cruft update --allow-untracked-files
################################################################################
#
# Checking and Linting
#
################################################################################
.PHONY: check cruft-check
check: cruft-check lint
cruft-check:
cruft check
$(PIPENV) cruft check
$(PIPENV) cruft diff
################################################################################
#
# Molecule logic
#
################################################################################
.PHONY: status lint converge test clean destroy
.PHONY: status lint check converge idempotence test destroy clean
status:
$(MOLECULE) list
@ -29,6 +52,9 @@ check:
converge:
$(MOLECULE) converge
idempotence:
$(MOLECULE) idempotence
test:
$(MOLECULE) test

9
roles/nomad/meta/main.yml

@ -1,7 +1,10 @@
---
galaxy_info:
author: Justin Lecher
description: Install and Configure HashiCorps nomad
author: "Justin Lecher"
description: "Install and Configure HashiCorps nomad"
role_name: "nomad"
namespace: "jlec.hashicorp"
license: Apache-2.0
min_ansible_version: 2.1
@ -12,7 +15,7 @@ galaxy_info:
- 20.04
- name: CentOS
versions:
- 7.8
- 7.9
galaxy_tags: []

2
roles/nomad/molecule/default/converge.yml

@ -2,7 +2,7 @@
- name: Converge
hosts: all
collections:
- jlec.hashicorp
- "jlec.hashicorp"
tasks:
- name: "Include nomad role"
include_role:

2
roles/nomad/tests/test.yml

@ -2,6 +2,6 @@
- hosts: localhost
remote_user: root
collections:
- jlec.hashicorp
- "jlec.hashicorp"
roles:
- role: "nomad"
Loading…
Cancel
Save