- Products
- Learn
- Local User Groups
- Partners
- More
CheckMates Fifth Birthday
Celebrate with Us!
days
hours
minutes
seconds
Join the CHECKMATES Everywhere Competition
Submit your picture to win!
Harmony Mobile 4:
New Version, New Capabilities
As YOU DESERVE THE BEST SECURITY
Upgrade to our latest GA Jumbo
CheckFlix!
All Videos In One Space
Hi team,
I am trying to use ansible with Red Hat Enterprise server 8 for a customer. The Playbook created works fine, However i get warnings like the one shown below.
I can login to the management server and the objects.
Any workarounds or solutions for this?
Hi,
The warning message you get seems to be because the parameters you wrote for your login command in the playbook is interpreted by the YAML parser as a dictionary, rather than as a string.
I guess that later when Ansible tries to pass the parameters specified in the task to the check_point_mgmt module, since the parameters in the login command is defined as a dictionary, it converts the dictionary to a string and this generates the warning.
Can you try to format your login command like we do in the example on our the cpAnsible GitHub repository to something like this:
- name: "login"
check_point_mgmt:
command: login
parameters:
username: "{{mgmt_user}}" # Variables set in /etc/ansible/hosts, to avoid needing
password: "{{mgmt_password}}" # to type your login details in every playbook.
management: "{{mgmt_server}}"
fingerprint: "XX:XX:XX:XX:XX:XX" # Mgmt Server's fingerprint
register: login_response # Register the output from the login
# command so we can use it later to run commands.
Kind Regards
Jim
the format seems correct.
Hi,
It seems like it is not the updated module after all.
Thanks to @Ryan_Darst for pointing this out to me, there seems to be a behaviour changes in ansible 2.8 and later.
Module option conversion to string
Beginning in version 2.8, Ansible will warn if a module expects a string, but a non-string value is passed and automatically converted to a string. This highlights potential problems where, for example, a yes or true (parsed as truish boolean value) would be converted to the string 'True', or where a version number 1.10 (parsed as float value) would be converted to '1.0'. Such conversions can result in unexpected behavior depending on context.
This behavior can be changed to be an error or to be ignored by setting the ANSIBLE_STRING_CONVERSION_ACTION environment variable, or by setting the string_conversion_action configuration in the defaults section of ansible.cfg.
You can add the following the defaults section of ~/.ansible.cfg or /etc/ansible/ansible.cfg
[defaults]
string_conversion_action = ignore
This is the result I get after adding that to my ~/.ansible.cfg
Please note that R&D is currently working on an official (by default included) module for ansible where this should be addressed.
Thanks for that!
About CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY