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

Cannot pass all-in-one-mode assertion #19

Open
jessequinn opened this issue Aug 10, 2021 · 1 comment
Open

Cannot pass all-in-one-mode assertion #19

jessequinn opened this issue Aug 10, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@jessequinn
Copy link

What happened?

TASK [cloudalchemy.cortex : Services should be empty when all-in-one-mode is enabled] **************************************************************************************************************************************************
fatal: [cortex]: FAILED! => {
    "assertion": "cortex_all_in_one == (cortex_services|length == 0)",
    "changed": false,
    "evaluated_to": false,
    "msg": "Exactly one of cortex_all_in_one or cortex_services should be set."
}

Did you expect to see some different?

expected to pass assertion.

How to reproduce it (as minimally and precisely as possible):

- hosts: all
   roles:
    - cloudalchemy.cortex

Environment

  • Role version:

    `jesse.quinn@monitoring-security:~/ansible$ ansible-galaxy role list

/home/jesse.quinn/.ansible/roles

  • cloudalchemy.cortex, master
    `
  • Ansible version information:

    ansible --version
    ansible 2.9.6 config file = /home/jesse.quinn/ansible/ansible.cfg configured module search path = ['/home/jesse.quinn/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible executable location = /usr/bin/ansible python version = 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0]

  • Variables:

n/a

  • Ansible playbook execution Logs:
TASK [cloudalchemy.cortex : Services should be empty when all-in-one-mode is enabled] **************************************************************************************************************************************************
fatal: [cortex]: FAILED! => {
    "assertion": "cortex_all_in_one == (cortex_services|length == 0)",
    "changed": false,
    "evaluated_to": false,
    "msg": "Exactly one of cortex_all_in_one or cortex_services should be set."
}
@jessequinn jessequinn added the bug Something isn't working label Aug 10, 2021
@lekkalraja
Copy link

lekkalraja commented Aug 14, 2021

Hi, I am also facing the same issue.. so found quick work around for this assertion task as below.
preflight.yml:
tasks:

       - name: Services should be empty when all-in-one-mode is enabled
         assert:
            that: cortex_all_in_one == (cortex_services|length == 0)| bool
            msg: "Exactly one of cortex_all_in_one or cortex_services should be set."
         when: cortex_services is defined or (cortex_all_in_one | default(true) == false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants