You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ansible-lint 6.20.0 using ansible-core:2.15.4 ansible-compat:4.1.10 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7
(I tried with version 6.18 and 6.17.1 too)
ansible installation method: OS package
ansible-lint installation method: OS package
STEPS TO REPRODUCE
run the following playbook.
- name: Demo hosts: localhost gather_facts: false tasks: - name: Use seed in random ansible.builtin.debug: msg: "{{ 65534 | ansible.builtin.random(seed=inventory_hostname) }}"
Desired Behavior
I hoped for this code to pass.
Actual Behavior
the output of running ansible-playbook including the command line used:
ansible-playbook test.yml
PLAY [Demo] ********************************************************************************************************************************************************************************************************************************
TASK [Use seed in random] ******************************************************************************************************************************************************************************************************************
mardi 26 septembre 2023 16:01:05 +0200 (0:00:00.013) 0:00:00.013 *******
ok: [localhost] =>
msg: '43927'
the output of running ansible-lint including the command line used
ansible-lint test.yml
WARNING Skipped installing old role dependencies due to running in offline mode.
WARNING Skipped installing collection dependencies due to running in offline mode.
WARNING Listing 1 violation(s) that are fatal
jinja[invalid]: Unexpected templating type error occurred on ({{ 65534 | random(seed=inventory_hostname) }}): The only supported seed types are: None,
int, float, str, bytes, and bytearray.. The only supported seed types are: None,
int, float, str, bytes, and bytearray.
if you're getting a stack trace, also the output of ansible-playbook --syntax-check playbook
Summary
The "idempotent method to generate unique hashes per system is to use a salt that is consistent between runs"
found here: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html#hashing-and-encrypting-strings-and-passwords works as expected.
But ansible-lint returns an error :
The only supported seed types are: None, int, float, str, bytes, and bytearray.
Issue Type
OS / ENVIRONMENT
ansible-lint 6.20.0 using ansible-core:2.15.4 ansible-compat:4.1.10 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7
(I tried with version 6.18 and 6.17.1 too)
STEPS TO REPRODUCE
Desired Behavior
I hoped for this code to pass.
Actual Behavior
ansible-playbook --syntax-check playbook
The text was updated successfully, but these errors were encountered: