Giter Site home page Giter Site logo

Comments (9)

robertdebock avatar robertdebock commented on August 30, 2024 3

Wow, I've never seen that issue before. That's worth a mention in the "requirements" section of the README.md.

from ansible-role-bootstrap.

robertdebock avatar robertdebock commented on August 30, 2024

Hi, @quotengrote. Thanks for your issue.

I'm intrigued by this issue; the default value is no. You could leave the variable out of your playbook, although it looks completely fine. You may experiment using False or 0 instead of no.

The default settings (and a few tasks to troubleshoot the value):

    TASK [ansible-role-bootstrap : show bootstrap_wait_for_host] *******************
    ok: [bootstrap-fedora-latest] => 
      msg: 'False'
    
    TASK [ansible-role-bootstrap : show type of bootstrap_wait_for_host] ***********
    ok: [bootstrap-fedora-latest] => 
      msg: bool
    
    TASK [ansible-role-bootstrap : test if bootstrap_wait_for_host is set correctly] ***
    ok: [bootstrap-fedora-latest]

The variable bootstrap_retries: 1 is not in use anymore, you could also leave it out.

I see you are pinning to a commit-hash. I sometimes experiment, but when everything is working, I release a version. I would pin to a version rather than a commit-hash. I've just released 4.3.5.

Please let me know if changing to False over no or updating works for you, although I don't see how.

from ansible-role-bootstrap.

quotengrote avatar quotengrote commented on August 30, 2024

The variable bootstrap_retries: 1 is not in use anymore, you could also leave it out.

removed

I see you are pinning to a commit-hash. I sometimes experiment, but when everything is working, I release a version. I would pin to a version rather than a commit-hash. I've just released 4.3.5.

For the test i pinned this version, but...

Please let me know if changing to False over no or updating works for you, although I don't see how.

neither false, no or 0 did the trick

from ansible-role-bootstrap.

robertdebock avatar robertdebock commented on August 30, 2024

Thanks for the feedback, what a weird issue, can't really reproduce it.

I typically test values using this types role. In there, no returns as a boolean.

I'm not sure how to try to reproduce your situation. Maybe try that robertdebock.types role, see how it reacts.

I've given it a try on my ansible-tester repo, seems to work.

from ansible-role-bootstrap.

quotengrote avatar quotengrote commented on August 30, 2024

Hi, i've tried your Types-Role.
Its the same error like the bootstrap role.
I'll build my ansible-host new. Same error on a completely new host.

Log

mg@ansible:~/ansible$ ansible-playbook playbooks/on-off/types.yml -i inventory --limit acng.grote.lan

PLAY [all] *******************************************************************************************

TASK [Gathering Facts] *******************************************************************************
ok: [acng.grote.lan]

TASK [ansible-role-types : include assert.yml] *******************************************************
included: /home/mg/ansible/roles/ansible-role-types/tasks/assert.yml for acng.grote.lan

TASK [ansible-role-types : test if types_strings is set correctly] ***********************************
ok: [acng.grote.lan]

TASK [ansible-role-types : test if types_integers is set correctly] **********************************
ok: [acng.grote.lan]

TASK [ansible-role-types : test if types_booleans is set correctly] **********************************
ok: [acng.grote.lan]

TASK [ansible-role-types : test if types_floats is set correctly] ************************************
ok: [acng.grote.lan]

TASK [ansible-role-types : show strings] *************************************************************
ok: [acng.grote.lan] => (item=hello) => {
    "msg": "hello is type str"
}
ok: [acng.grote.lan] => (item=1.2.3) => {
    "msg": "1.2.3 is type str"
}

TASK [ansible-role-types : test strings] *************************************************************
ok: [acng.grote.lan] => (item=hello) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": "hello",
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=1.2.3) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": "1.2.3",
    "msg": "All assertions passed"
}

TASK [ansible-role-types : show integers] ************************************************************
ok: [acng.grote.lan] => (item=0) => {
    "msg": "0 is type int"
}
ok: [acng.grote.lan] => (item=1) => {
    "msg": "1 is type int"
}
ok: [acng.grote.lan] => (item=2) => {
    "msg": "2 is type int"
}
TASK [ansible-role-types : test integers] ************************************************************
ok: [acng.grote.lan] => (item=0) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": 0,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=1) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": 1,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=2) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": 2,
    "msg": "All assertions passed"
}

TASK [ansible-role-types : show booleans] ************************************************************
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
TASK [ansible-role-types : test booleans] ************************************************************
fatal: [acng.grote.lan]: FAILED! => {"msg": "The conditional check 'item is boolean' failed. The error was: template error while templating string: no test named 'boolean'. String: {% if item is boolean %} True {% else %} False {% endif %}"}

PLAY RECAP *******************************************************************************************
acng.grote.lan             : ok=11   changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

from ansible-role-bootstrap.

robertdebock avatar robertdebock commented on August 30, 2024

Okay, I'm starting to get a feeling:

The error was: template error while templating string: no test named 'boolean'

This is an assumption: Your version of jinja does not have the test boolean. I'm guessing you're using an unexpected version of Jinja.

On my system pip show Jinja2 shows:

Name: Jinja2
Version: 2.11.2
Summary: A very fast and expressive template engine.
Home-page: https://palletsprojects.com/p/jinja/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD-3-Clause
Location: /home/robertdb/.local/lib/python3.9/site-packages
Requires: MarkupSafe
Required-by: molecule, jinja2-time, cookiecutter, click-completion, ansible-base

Can you tell me what version of Jinja you have?

In my installation I can find jinja2/test.py with a contents of: (partial, snippet)

TESTS = {
# STUFF REMOVED
    "boolean": test_boolean,
# STUFF REMOVED

from ansible-role-bootstrap.

quotengrote avatar quotengrote commented on August 30, 2024

Looks like it.

Before

mg@ansible:~/ansible$ pip show Jinja2
Name: Jinja2
Version: 2.10.1
Summary: A small but fast and easy to use stand-alone template engine written in pure python.
Home-page: http://jinja.pocoo.org/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD
Location: /usr/lib/python3/dist-packages
Requires:
Required-by: ansible-base

After Update to...

mg@ansible:~/ansible$ pip show Jinja2
Name: Jinja2
Version: 2.11.2
Summary: A very fast and expressive template engine.
Home-page: https://palletsprojects.com/p/jinja/
Author: Armin Ronacher
Author-email: [email protected]
License: BSD-3-Clause
Location: /home/mg/.local/lib/python3.8/site-packages
Requires: MarkupSafe
Required-by: ansible-base

types

TASK [ansible-role-types : show booleans] ***************************************************************************************************************************************************
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=True) => {
    "msg": "True is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}
ok: [acng.grote.lan] => (item=False) => {
    "msg": "False is type bool"
}

TASK [ansible-role-types : test booleans] ***************************************************************************************************************************************************
ok: [acng.grote.lan] => (item=True) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": true,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=True) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": true,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=True) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": true,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=True) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": true,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=True) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": true,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=True) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": true,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=False) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": false,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=False) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": false,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=False) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": false,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=False) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": false,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=False) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": false,
    "msg": "All assertions passed"
}
ok: [acng.grote.lan] => (item=False) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": false,
    "msg": "All assertions passed"
}


tl;dr

It works now with Jinja2 - Version: 2.11.2 and ansible 2.10.1. THX

from ansible-role-bootstrap.

Climberdav avatar Climberdav commented on August 30, 2024

Hi,
I encounter the same issue, on AWX running playbooks on RHEL7 and RHEL8.
It's the latest major version of AWX (15.0) and Jinja is in version 2.11.2 (after manuel upgrade) and ansible in v 2.9.15 on Centos 8.3.2011, can't install 2.10.
Can you see if a fix is possible ?
Thanks

from ansible-role-bootstrap.

robertdebock avatar robertdebock commented on August 30, 2024

Hi @Climberdav, I will update the documentation and introduce a requirements.txt file that describe these requirements.

In case you can't update the controller, you can always refer to an older version of the role, until the controller has been updated.

Sorry that I'm unable to help you directly, hope the older version help you out.

from ansible-role-bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.