title: Unknown Error when installing confluent kafka via Ansible
body: <p>We are trying to install and run Kafka and its components using Ansible.
  Following the github source for playbooks and inventories defined in  6.2.2-post version.
  <a href="https://github.com/confluentinc/cp-ansible/tree/6.2.2-post" rel="nofollow noreferrer">https://github.com/confluentinc/cp-ansible/tree/6.2.2-post</a></p>
  <p>The infrastructure for Kafka nodes is as follows:
  Brokers nodes: 3
  Zookeeper nodes: 3
  Kafka connect nodes: 2
  Kafka control center node: 1
  Kafka REST proxy nodes: 2
  Kafka schema registry nodes: 2</p>
  <p>We are currently using a self signed SSL certificate, LDAP and RBAC settings have been set up, we have disabled the SSL part for the brokers to attempt to get the environment up and running as we struggle to sort out some security part (certs and keystores).</p>
  <p>Our inventory is as follows:</p>
  <pre><code>---
  # Production Inventory
  all:
    vars:
      #Ansible
      # For debugging OpenLdap
      controller_mds_private_key_stat:
        stat:
          exists: false
  #    mask_sensitive_logs: false
  
      ansible_connection: ssh
      ansible_user: root
      ansible_become: true
      ansible_ssh_private_key_file: ~/.ssh/id_rsa
  
      #Cluster config
      kafka_broker_cluster_name: prod_broker
      schema_registry_cluster_name: prod_schema
      kafka_connect_cluster_name: prod_connect
  
      #These are not needed when we are using a specific branch to install
      #confluent_package_version: 6.2.2
      #confluent_server_enabled: true
  
      #Monitoring
      jmxexporter_enabled: true
      jolokia_enabled: true
  
      #Proxy
      proxy_server: '&lt;proxy_address&gt;'
      proxy_env:
        http_proxy: '{{ proxy_server }}'
        https_proxy: '{{ proxy_server }}'
        no_proxy: '&lt;list of hosts&gt;'
  
      inventory: 'production'
      beat_tags:
        - 'kafka'
      reboot: true
  
      # License
      confluent_license: ''
      schema_registry_custom_properties:
        confluent.license: &quot;{{ confluent_license }}&quot;
      kafka_connect_custom_properties:
        confluent.license: &quot;{{ confluent_license }}&quot;
      control_center_custom_properties:
        confluent.license: &quot;{{ confluent_license }}&quot;
      kafka_rest_custom_properties:
        confluent.license: &quot;{{ confluent_license }}&quot;
  
      #SSL Config
      regenerate_ca: true
      regenerate_keystore_and_truststore: true
      ssl_enabled: true
      sasl_protocol: plain
  
      #Broker SSL config
      #kafka_broker_custom_listeners:
        #client_listener:
          #name: CLIENT
          #port: 9093
          #ssl_enabled: true
          #ssl_mutual_auth_enabled: true
          #sasl_protocol: plain
  
      #For LDAP Authentication
      kafka_broker_custom_properties:
        confluent.license: &quot;{{ confluent_license }}&quot;
        listener.name.client.plain.sasl.jaas.config: 'org.apache.kafka.common.security.plain.PlainLoginModule required username=&quot;broker&quot; password=&lt;password&gt;'
  
        listener.name.client.plain.sasl.server.callback.handler.class: 'io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler'
  
        # Authentication of confluent server to ldap server
        ldap.java.naming.factory.initial: com.sun.jndi.ldap.LdapCtxFactory
        ldap.com.sun.jndi.ldap.read.timeout: 3000
        #For active directory the port might be different
        ldap.java.naming.provider&lt;ldapURL&gt;
        # this is the auth you use in ldapsearch. This user should be able to search in the entire
        # LDAP tree
        ldap.java.naming.security.principal: cn=confluent_auth,ou=system-ids,o=nwu
        # The password for that user
        ldap.java.naming.security.credentials: &lt;password&gt;
        ldap.java.naming.security.authentication: simple
  
        # User Configuration
        ldap.user.search.scope: 2
        ldap.user.search.base: o=nwu
        ldap.user.name.attribute: cn
        ldap.user.object.class: inetOrgPerson
  
        # Group Configuration
        ldap.search.mode: GROUPS
        ldap.group.search.base: ou=groups,o=nwu
        ldap.group.name.attribute: cn
        ldap.group.object.class: groupOfNames
        ldap.group.member.attribute: member
        ldap.group.member.attribute.pattern: cn=(\\w+),.*
        ldap.group.search.scope: 2
  
        # Filters
        ldap.user.search.filter: '(|(memberOf=cn=confluent_administrators,ou=orgunits,ou=groups,o=nwu)(memberOf=cn=confluent_components,ou=groups,o=nwu)(memberOf=cn=producers,ou=groups,o=nwu))'
        ldap.group.search.filter: '(description=confluent)'
  
      # RBAC usernames &amp; passwords for kafka
      rbac_enabled: true
      #regenerate_token_pem: false
      #create_mds_certs: true
      mds_super_user: &lt;username&gt;
      mds_super_user_password: &lt;password&gt;
      kafka_broker_ldap_user: &lt;username&gt;
      kafka_broker_ldap_password: &lt;password&gt;
      schema_registry_ldap_user: &lt;username&gt;
      schema_registry_ldap_password: &lt;password&gt;
      kafka_connect_ldap_user: &lt;username&gt;
      kafka_connect_ldap_password: &lt;password&gt;
      control_center_ldap_user: &lt;username&gt;
      control_center_ldap_password: &lt;password&gt;
      kafka_rest_ldap_user: &lt;username&gt;
      kafka_rest_ldap_password: &lt;password&gt;
  
      token_services_public_pem_file: ../files/public.pem
      token_services_private_pem_file: ../files/tokenKeypair.pem
  
  zookeeper:
    vars:
      vmLVMs:
        - { vg: data, lv: data, path: /var/lib/kafka/data, pvs: '/dev/sdb1', owner: 'cp-kafka', group: 'confluent' }
    hosts:
      &lt;zookeeper_fqdn&gt;:
        ip_addr: &lt;ip&gt;
      &lt;zookeeper_fqdn&gt;:
        ip_addr: &lt;ip&gt;
      &lt;zookeeper_fqdn&gt;:
        ip_addr: &lt;ip&gt;
  
  kafka_broker:
    vars:
      vmLVMs:
        - { vg: data, lv: data, path: /var/lib/kafka/data, pvs: '/dev/sdb1', owner: 'cp-kafka', group: 'confluent' }
      filebeat_modules:
        - 'system'
        - 'kafka'
      metricbeat_modules:
        - 'system'
        - 'kafka'
    hosts:
      &lt;broker_fqdn&gt;:
        ip_addr: &lt;ip&gt;
        broker_id: 1
        kafka_broker_custom_properties:
          broker.rack: 'dc1'
      &lt;broker_fqdn&gt;:
        ip_addr: &lt;ip&gt;
        broker_id: 2
        kafka_broker_custom_properties:
          broker.rack: 'dc1'
      &lt;broker_fqdn&gt;:
        ip_addr: &lt;ip&gt;
        broker_id: 3
        kafka_broker_custom_properties:
          broker.rack: 'dc2'
  
  schema_registry:
    hosts:
      &lt;schema_fqdn&gt;:
        ip_addr: &lt;ip&gt;
      &lt;schema_fqdn&gt;:
        ip_addr: &lt;ip&gt;
  
  kafka_rest:
    hosts:
       &lt;rest_fqdn&gt;:
         ip_addr: &lt;ip&gt;
       &lt;rest_fqdn&gt;:
         ip_addr: &lt;ip&gt;
  
  kafka_connect:
    hosts:
     &lt;connect_fqdn&gt;:
        ip_addr: &lt;ip&gt;
      &lt;connect_fqdn&gt;:
        ip_addr: &lt;ip&gt;
  
  control_center:
    vars:
      vmLVMs:
        - { vg: data, lv: data, path: /var/lib/kafka/data, pvs: '/dev/sdb1', owner: 'cp-kafka', group: 'confluent' }
    hosts:
      &lt;control_fqdn&gt;:
        ip_addr: &lt;ip&gt;
  </code></pre>
  <p>Task on which Ansible fails:</p>
  <pre><code>TASK [confluent.kafka_broker : Register Kafka Cluster] *****************************************************************
  </code></pre>
  <pre><code>fatal: [&lt;BROKER_URL&gt;]: FAILED! =&gt; {
      &quot;changed&quot;: false,
      &quot;connection&quot;: &quot;close&quot;,
      &quot;content&quot;: &quot;{\&quot;status_code\&quot;:500,\&quot;message\&quot;:\&quot;Error updating Cluster Registry\&quot;,\&quot;type\&quot;:\&quot;CLUSTER REGISTRY UPDATE\&quot;}&quot;,
      &quot;content_length&quot;: &quot;96&quot;,
      &quot;content_type&quot;: &quot;application/json&quot;,
      &quot;date&quot;: &quot;Tue, 17 May 2022 16:21:06 GMT&quot;,
      &quot;elapsed&quot;: 0,
      &quot;invocation&quot;: {
          &quot;module_args&quot;: {
              &quot;attributes&quot;: null,
              &quot;backup&quot;: null,
              &quot;body&quot;: [
                  {
                      &quot;clusterName&quot;: &quot;prod_broker&quot;,
                      &quot;hosts&quot;: [
                          {
                              &quot;host&quot;: &quot;&lt;BROKER_URL&gt;:&quot; // Broker 1
                              &quot;port&quot;: 9092
                          },
                          {
                              &quot;host&quot;: &quot;&lt;BROKER_URL&gt;&quot;, // broker 2
                              &quot;port&quot;: 9092
                          },
                          {
                              &quot;host&quot;: &quot;&lt;BROKER_URL&gt;&quot;, // broker 3
                              &quot;port&quot;: 9092
                          }
                      ],
                      &quot;protocol&quot;: &quot;SASL_SSL&quot;,
                      &quot;scope&quot;: {
                          &quot;clusters&quot;: {
                              &quot;kafka-cluster&quot;: &quot;XXXXXXXXXXXXXX&quot;
                          }
                      }
                  }
              ],
              &quot;body_format&quot;: &quot;json&quot;,
              &quot;client_cert&quot;: null,
              &quot;client_key&quot;: null,
              &quot;content&quot;: null,
              &quot;creates&quot;: null,
              &quot;delimiter&quot;: null,
              &quot;dest&quot;: null,
              &quot;directory_mode&quot;: null,
              &quot;follow&quot;: false,
              &quot;follow_redirects&quot;: &quot;safe&quot;,
              &quot;force&quot;: false,
              &quot;force_basic_auth&quot;: true,
              &quot;group&quot;: null,
              &quot;headers&quot;: {
                  &quot;Content-Type&quot;: &quot;application/json&quot;
              },
              &quot;http_agent&quot;: &quot;ansible-httpget&quot;,
              &quot;method&quot;: &quot;POST&quot;,
              &quot;mode&quot;: null,
              &quot;owner&quot;: null,
              &quot;regexp&quot;: null,
              &quot;remote_src&quot;: null,
              &quot;removes&quot;: null,
              &quot;return_content&quot;: false,
              &quot;selevel&quot;: null,
              &quot;serole&quot;: null,
              &quot;setype&quot;: null,
              &quot;seuser&quot;: null,
              &quot;src&quot;: null,
              &quot;status_code&quot;: [
                  &quot;204&quot;
              ],
              &quot;timeout&quot;: 30,
              &quot;unix_socket&quot;: null,
              &quot;unsafe_writes&quot;: null,
              &quot;url&quot;: &quot;&lt;BROKER_URL&gt;:8090/security/1.0/registry/clusters&quot;,
              &quot;url_password&quot;: &quot;VALUE_SPECIFIED_IN_NO_LOG_PARAMETER&quot;,
              &quot;url_username&quot;: &quot;&lt;USER_NAME&gt;&quot;,
              &quot;use_proxy&quot;: true,
              &quot;validate_certs&quot;: false
          }
      },
      &quot;json&quot;: {
          &quot;message&quot;: &quot;Error updating Cluster Registry&quot;,
          &quot;status_code&quot;: 500,
          &quot;type&quot;: &quot;CLUSTER REGISTRY UPDATE&quot;
      },
      &quot;msg&quot;: &quot;Status code was 500 and not [204]: HTTP Error 500: Internal Server Error&quot;,
      &quot;redirected&quot;: false,
      &quot;status&quot;: 500,
      &quot;url&quot;: &quot;&lt;BROKER_URL&gt;:8090/security/1.0/registry/clusters&quot;
  }
  </code></pre>
  <p>If anyone has any idea what is going wrong or where we can look for an issue that would be greatly appreciated. Thanks</p>