Add your description here
Project description
ansible-lint-custom-strict-naming
Rules
var_name_prefix
-
<role_name>_role__
,<task_name>_task__
-
prefix Variables defined in <role_name>_role__
roles/tasks/
<role_name>_tasks__
<not_roles>/tasks/
-
In ansible-lint,
var-naming[no-role-prefix]
require to use<role_name>_
as prefix. But it is not enough to avoid name collision or search defined position. So, I add_role__
or_tasks__
to the prefix.
-
-
var__
,const__
-
prefix description var__
Variables dynamically defined by ansible.builtin.set_fact
orregister
const__
Variables statistically defined in such like inventory's vars, group_vars and host_vars
-
-
prefix precedence
-
descending order
- role or task prefix
- var or const prefix
-
examples
var description var__fizz
defined in playbook by ansible.builtin.set_fact
orregister
some_role__var__fizz
defined in roles/tasks
byansible.builtin.set_fact
orregister
some_role__const__fizz
defined by ansible.builtin.include_role
's vars key and not changed inroles/tasks
some_tasks__var__fizz
defined in tasks
byansible.builtin.set_fact
orregister
some_tasks__const__fizz
defined by ansible.builtin.include_role
's vars key and not changed intasks
tasks: - name: Some task ansible.builtin.include_role: name: <role_name> vars: some_role__const__one: value1 some_role__const__two: value2
-
Others
Why double underscores?
- Single underscore (
_
) is used to separate words. Double underscores (__
) are used to separate chunks for readability. - examples
var__send_message__user_id
var__send_message__content
some_role__const__app_config__name
some_role__const__app_config__token
some_role__const__app_config__version
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ansible-lint-custom-strict-naming-0.1.1.tar.gz
.
File metadata
- Download URL: ansible-lint-custom-strict-naming-0.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcf152774103f27928a05153ce9fd44eb4bc5170b0b42b570449a5d1e18ba06d |
|
MD5 | 978dbfbdf96d0c8c486f198c8876e813 |
|
BLAKE2b-256 | 3db11d88b0144ffaf65fb23d5446d2481d0a09985ba9e0bf5f1a1877680dad0b |
File details
Details for the file ansible_lint_custom_strict_naming-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: ansible_lint_custom_strict_naming-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e4b408a1feaafbd48523eb3c2e7a5e6c384775aa692e26eab440e7fedebfe6a |
|
MD5 | 61e84b7151b19ad5c713f699bef8b4b8 |
|
BLAKE2b-256 | 195c5f9f5bae6ec0ec3f7d64ead19d8d9d5a9adee31e81e55cd2e2a936449a85 |