Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.
This repository was archived by the owner on May 24, 2023. It is now read-only.

Conditional Check failed  #15

Open
@mashoodakram

Description

@mashoodakram

Describe the bug

TASK [nginxinc.nginx_controller.nginx_controller_environment : create if environment is absent, update if present] ***
failing with conditional check error after controller installs successfully.

To reproduce

Steps to reproduce the behaviour:

  1. As part of install of nginx collections after successful install of controller run environment role as task.
- name: create environment
  hosts: role_nginx_controller_defraclouddev2
  gather_facts: no

  vars:
   nginx_controller_user_email: "xxxxxxx"
   nginx_controller_user_password: "xxxxxxxx"
   nginx_controller_fqdn: "nginx-controller2-dev.azure.defra.cloud"
   nginx_controller_validate_certs: false

  tasks:
  - name: Retrieve the NGINX Controller auth token
    include_role:
     name: nginxinc.nginx_controller.nginx_controller_generate_token

  - name: Configure the environment
    include_role:
     name: nginxinc.nginx_controller.nginx_controller_environment
    vars:
     nginx_controller_environment:
       metadata:
         name: "dev-sandbox2"
         displayName: "developer sandbox environment2"
         description: "sandbox environment for internal development2"

  tags:
   - create-environment
  1. See error
2021-10-25T14:50:17.5158001Z TASK [nginxinc.nginx_controller.nginx_controller_environment : create if environment is absent, update if present] ***
2021-10-25T14:50:17.5159052Z Monday 25 October 2021  14:50:17 +0000 (0:00:00.099)       0:12:32.759 ******** 
2021-10-25T14:50:17.5160245Z Monday 25 October 2021  14:50:17 +0000 (0:00:00.099)       0:12:32.758 ******** 
2021-10-25T14:50:17.9317312Z fatal: [SECNGXCTLSR1003]: FAILED! => {"msg": "The conditional check 'nginx_controller_environment_current_status.json.currentStatus.state.selfConfigState.isError | bool' failed. The error was: error while evaluating conditional (nginx_controller_environment_current_status.json.currentStatus.state.selfConfigState.isError | bool): 'dict object' has no attribute 'currentStatus'"}
2021-10-25T14:50:17.9323107Z ...ignoring
2021-10-25T14:50:17.9635823Z 
2021-10-25T14:50:17.9637341Z TASK [nginxinc.nginx_controller.nginx_controller_environment : report failure details from Controller] ***
2021-10-25T14:50:17.9638505Z Monday 25 October 2021  14:50:17 +0000 (0:00:00.447)       0:12:33.207 ******** 
2021-10-25T14:50:17.9639498Z Monday 25 October 2021  14:50:17 +0000 (0:00:00.447)       0:12:33.206 ******** 
2021-10-25T14:50:18.0202379Z fatal: [SECNGXCTLSR1003]: FAILED! => {"msg": "The conditional check 'nginx_controller_environment_current_status.json.currentStatus.state.selfConfigState.isError | bool' failed. The error was: error while evaluating conditional (nginx_controller_environment_current_status.json.currentStatus.state.selfConfigState.isError | bool): 'dict object' has no attribute 'json'\n\nThe error appears to be in '/ansibleagent/_work/1/s/collections/ansible_collections/nginxinc/nginx_controller/roles/nginx_controller_environment/tasks/main.yml': line 41, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n # above simply errors but does not include the informative failure messages from Controller\n- name: report failure details from Controller\n  ^ here\n"}

Expected behavior

Run role -name create environment after controller install then continue with steps defined in playbook - name: create location then agents tasks.

Your environment:

controller-installer-3.20.1.tar.gz
remote controller Ubuntu 18.04.5 LTS
Azure Database for PostgreSQL server PostgresSQL 9.6

ansible [core 2.11.4]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/vmadmin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible
ansible collection location = /home/vmadmin/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
jinja version = 2.10
libyaml = True

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions