Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The conditional check 'XX <= 15' failed. The error was: Conditional is marked as unsafe, and cannot be evaluated. #555

Closed
audiolomb opened this issue Dec 19, 2023 · 3 comments
Assignees

Comments

@audiolomb
Copy link

Summary

When running sap_general_preconfigure, getting the error above.

Issue Type

Bug Report

Component Name

sap_general_preconfigure

Ansible Version

$ ansible --version

ansible [core 2.16.2]
config file = /home/user/ansible/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
ansible collection location = /home/user/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.11.5 (main, Sep 7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3.11)
jinja version = 3.1.2
libyaml = True

Community.sap_install Version

$ ansible-galaxy collection list community.sap_install
community.sap_install 1.3.2  

Configuration

$ ansible-config dump --only-changed

COLLECTIONS_PATHS(env: ANSIBLE_COLLECTIONS_PATH) = ['/home/user/ansible/collections']
CONFIG_FILE() = /home/user/ansible/ansible.cfg
DEFAULT_ACTION_PLUGIN_PATH(/home/user/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/action']
DEFAULT_FORKS(/home/user/ansible/ansible.cfg) = 50
DEFAULT_REMOTE_USER(/home/user/ansible/ansible.cfg) = ansible
DEFAULT_ROLES_PATH(env: ANSIBLE_ROLES_PATH) = ['/home/user/ansible/roles']
DEFAULT_VAULT_PASSWORD_FILE(/home/user/ansible/ansible.cfg) = /home/user/vault-pass
HOST_KEY_CHECKING(/home/user/ansible/ansible.cfg) = False

OS / Environment

RHEL 9 (VMware)

Steps to Reproduce

  - import_role:
      name: community.sap_install.sap_general_preconfigure

VARS:
sap_general_preconfigure_reboot_ok: true
sap_general_preconfigure_selinux_state: disabled
sap_general_preconfigure_modify_selinux_labels: false
sap_general_preconfigure_max_hostname_length: 15

Expected Results

I expect the task "community.sap_install.sap_general_preconfigure : Ensure that the length of the hostname is not longer than 'sap_general_preconfigure_max_hostname_length'" to complete. Instead Ansible crashes

Actual Results

TASK [community.sap_install.sap_general_preconfigure : Ensure that the length of the hostname is not longer than 'sap_general_preconfigure_max_hostname_length'] ***
task path: /home/user/ansible/playbook/prod/collections/ansible_collections/community/sap_install/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-hostname.yml:51
fatal: [hostname.domain]: FAILED! => {
    "msg": "The conditional check '10 <= 15' failed. The error was: Conditional is marked as unsafe, and cannot be evaluated."
}

PLAY RECAP ***********************************************************************************************************************************************
hostname.domain     : ok=74   changed=2    unreachable=0    failed=1    skipped=68   rescued=0    ignored=0   
@audiolomb audiolomb changed the title The conditional check '10 <= 15' failed. The error was: Conditional is marked as unsafe, and cannot be evaluated. The conditional check 'XX <= 15' failed. The error was: Conditional is marked as unsafe, and cannot be evaluated. Dec 19, 2023
@berndfinger berndfinger self-assigned this Dec 20, 2023
@berndfinger
Copy link
Member

Hi @audiolomb audiolomb Many thanks for reporting this. I have just created #556 to broaden the scope.

@berndfinger
Copy link
Member

berndfinger added a commit to berndfinger/community.sap_install that referenced this issue Dec 20, 2023
berndfinger added a commit to berndfinger/community.sap_install that referenced this issue Dec 22, 2023
This commit makes the roles compatible with the following versions of
`ansible-core`:
- 2.16.1
- 2.15.8
- 2.14.12
when running in normal (=non-assert) mode.

The preconfigure roles also support an extended check mode, called
assert mode, in which the roles do not change anything but verify
if all settings are correct. This commit will not cover the assert
mode. So several tasks of the preconfigure roles in assert mode will
fail. By using the `_assert_ignore_errors` role parameters in assert mode,
the roles will not fail but the affected tasks will not be executed so
those settings will not be validated.

Relates to issues sap-linuxlab#555 and sap-linuxlab#556.

Signed-off-by: Bernd Finger <[email protected]>
@berndfinger
Copy link
Member

Fixed in commit 738efaa, now part of collection release 1.3.3.

berndfinger added a commit to berndfinger/community.sap_install that referenced this issue Jan 5, 2024
Fixes sap-linuxlab#555 for this role.

Signed-off-by: Bernd Finger <[email protected]>
berndfinger added a commit to berndfinger/community.sap_install that referenced this issue Jan 8, 2024
Solves issue sap-linuxlab#555 for this role.

Signed-off-by: Bernd Finger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants