feat(tooling): added role skeleton for new ansible roles generated using Task
This commit is contained in:
parent
31aaf10a5c
commit
b6695cf49c
9 changed files with 54 additions and 1 deletions
|
@ -125,7 +125,7 @@ tasks:
|
||||||
COLLECTION_NAME: '{{default "nullified.infrastructure" .COLLECTION_NAME}}'
|
COLLECTION_NAME: '{{default "nullified.infrastructure" .COLLECTION_NAME}}'
|
||||||
ROLE_NAME: '{{index .MATCH 0}}'
|
ROLE_NAME: '{{index .MATCH 0}}'
|
||||||
cmds:
|
cmds:
|
||||||
- '{{.PYTHON_WRAPPER}} ansible-galaxy role init {{.ROLE_NAME}} --init-path {{.COLLECTIONS_DIR}}/{{.COLLECTION_NAME | replace "." "/"}}/roles'
|
- '{{.PYTHON_WRAPPER}} ansible-galaxy role init {{.ROLE_NAME}} --role-skeleton ./templates/ansible_role_skeleton --init-path {{.COLLECTIONS_DIR}}/{{.COLLECTION_NAME | replace "." "/"}}/roles'
|
||||||
|
|
||||||
ansible:new:collection:*:
|
ansible:new:collection:*:
|
||||||
desc: create a new collection
|
desc: create a new collection
|
||||||
|
|
29
templates/ansible_role_skeleton/README.md
Normal file
29
templates/ansible_role_skeleton/README.md
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
Role Name
|
||||||
|
=========
|
||||||
|
|
||||||
|
@todo
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
@todo
|
||||||
|
|
||||||
|
Role Variables
|
||||||
|
--------------
|
||||||
|
|
||||||
|
@todo
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
@todo
|
||||||
|
|
||||||
|
Example Playbook
|
||||||
|
----------------
|
||||||
|
|
||||||
|
@todo
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
[MIT](https://opensource.org/license/mit)
|
1
templates/ansible_role_skeleton/defaults/main.yml
Normal file
1
templates/ansible_role_skeleton/defaults/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
---
|
1
templates/ansible_role_skeleton/handlers/main.yml
Normal file
1
templates/ansible_role_skeleton/handlers/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
---
|
13
templates/ansible_role_skeleton/meta/main.yml
Normal file
13
templates/ansible_role_skeleton/meta/main.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
author: Florian L.
|
||||||
|
namespace: nullified
|
||||||
|
description:
|
||||||
|
license: MIT
|
||||||
|
min_ansible_version: 2.15
|
||||||
|
platforms:
|
||||||
|
- name: Debian
|
||||||
|
versions:
|
||||||
|
- bookworm
|
||||||
|
galaxy_tags: []
|
||||||
|
dependencies: []
|
1
templates/ansible_role_skeleton/tasks/main.yml
Normal file
1
templates/ansible_role_skeleton/tasks/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
---
|
2
templates/ansible_role_skeleton/tests/inventory
Normal file
2
templates/ansible_role_skeleton/tests/inventory
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
localhost
|
||||||
|
|
5
templates/ansible_role_skeleton/tests/test.yml
Normal file
5
templates/ansible_role_skeleton/tests/test.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
remote_user: root
|
||||||
|
roles:
|
||||||
|
- test
|
1
templates/ansible_role_skeleton/vars/main.yml
Normal file
1
templates/ansible_role_skeleton/vars/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
---
|
Loading…
Add table
Reference in a new issue