ERROR]: Task failed: Finalization of task args for 'ansible.builtin.set_fact' failed: Error while resolving value for 'infoblox_next_ip': The lookup plugin 'nios_next_ip' failed: a bytes-like object is required, not 'str'

7 views
Skip to first unread message

Lucas Weir

unread,
Oct 8, 2025, 2:06:19 PM (23 hours ago) Oct 8
to rundeck-discuss
Hello when attempting to run a ansible play via bash script on a remote RHEL 9 node i am getting "ERROR]: Task failed: Finalization of task args for 'ansible.builtin.set_fact' failed: Error while resolving value for 'infoblox_next_ip': The lookup plugin 'nios_next_ip' failed: a bytes-like object is required, not 'str'". This play is using the infoblox plugin to lookup ip addresses, it works great if i run on the remote node local CLI however when triggered from rundeck to the RHEL 9 node i get this error. From my testing it appears to be related to the password and special characters but im not 100% sure. Any ideas on how to troubleshoot?

Not working(trigger from rundeck): rundeck -> shell script -> ansible-playbook -> infoblox module
Working(local CLI on RHEL Node): 
ansible-playbook -> infoblox module

250 - name: Get next available IP address in given subnet with exclusions
251   ansible.builtin.set_fact:
252     infoblox_next_ip: >-
                          ^ column 23
<<< caused by >>>
a bytes-like object is required, not 'str'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "msg": "Task failed: Finalization of task args for 'ansible.builtin.set_fact' failed: Error while resolving value for 'infoblox_next_ip': The lookup plugin 'nios_next_ip' failed: a bytes-like object is required, not 'str'"
}

rac...@rundeck.com

unread,
Oct 8, 2025, 2:36:39 PM (23 hours ago) Oct 8
to rundeck-discuss
Hi,

Can you double-check that you're using the same Ansible environment under the rundeck user? Also, make sure that the rundeck user uses the UTF-8 encoding (as the user that runs the playbook "manually")

Adding the following env vars for the rundeck user:

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8 

Regards.
Reply all
Reply to author
Forward
0 new messages