Skip to content

Fix: Add loop instead of with_items - #204

Open
Rike0501 wants to merge 1 commit into
opensearch-project:mainfrom
Rike0501:fix/security-plugin-user-loop
Open

Rike0501 wants to merge 1 commit into
opensearch-project:mainfrom
Rike0501:fix/security-plugin-user-loop

Conversation

@Rike0501

Copy link
Copy Markdown

Description

On Execution of task: Security Plugin configuration | Set passwords for all users from custom config

Ansible verion = ansible [core 2.20.1]

I get the error:

TASK [linux/opensearch : Security Plugin configuration | Set passwords for all users from custom config] *******************************************
[ERROR]: Task failed: Finalization of task args for 'ansible.builtin.shell' failed: Error while resolving value for '_raw_params': Error rendering template: unsupported operand type(s) for +: '_AnsibleLazyTemplateDict' and 'str'

Task failed.
Origin: ./ansible-playbook/roles/linux/opensearch/tasks/security.yml:270:7

268     # Hashed passwords are written for all users found in the previous task. Passwords are searched in variables
269     # set by the user when starting the role (admin_password, kibanaserver_password, etc.).
270     - name: Security Plugin configuration | Set passwords for all users from custom config
          ^ column 7

<<< caused by >>>

Finalization of task args for 'ansible.builtin.shell' failed.
Origin:./ansible-playbook/roles/linux/opensearch/tasks/security.yml:271:7

269     # set by the user when starting the role (admin_password, kibanaserver_password, etc.).
270     - name: Security Plugin configuration | Set passwords for all users from custom config
271       ansible.builtin.shell: >
          ^ column 7

<<< caused by >>>

Error while resolving value for '_raw_params': Error rendering template: unsupported operand type(s) for +: '_AnsibleLazyTemplateDict' and 'str'
Origin: /home/tsprod.local/ebastijanic/ansible-playbook/roles/linux/opensearch/tasks/security.yml:271:30

269     # set by the user when starting the role (admin_password, kibanaserver_password, etc.).
270     - name: Security Plugin configuration | Set passwords for all users from custom config
271       ansible.builtin.shell: >
                                 ^ column 30

failed: [XXXXXXXXXXX] (item={'admin': {'hash': 'xxxxxxxx', 'reserved': True, 'backend_roles': ['admin'], 'description': 'admin user'}, 'kibanaserver': {'hash': 'xxxxxx', 'reserved': True, 'description': 'kibanaserver user'}, 'logstash': {'hash': 'xxxxxxxx', 'reserved': True, 'description': 'logstash user'}}) => {"ansible_loop_var": "item", "changed": false, "item": {"admin": {"backend_roles": ["admin"], "description": "admin user", "hash": "xxxxxxx", "reserved": true}, "kibanaserver": {"description": "kibanaserver user", "hash": "xxxxxxxxxx", "reserved": true}, "logstash": {"description": "logstash user", "hash": "xxxxxxxxxxx", "reserved": true}}, "msg": "Task failed: Finalization of task args for 'ansible.builtin.shell' failed: Error while resolving value for '_raw_params': Error rendering template: unsupported operand type(s) for +: '_AnsibleLazyTemplateDict' and 'str'"}

Signed-off-by: Erik Bastijanic <ebastijanic@bind.hr>
@Rike0501
Rike0501 force-pushed the fix/security-plugin-user-loop branch from fa9b931 to 98e033a Compare March 19, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant