<p>I'm using an Ansible JMeter Operator to do distributed load testing and am having trouble with creating a Kubernetes secret. The operator I'm modifying is <a href="https://github.com/kubernauts/jmeter-operator" rel="noreferrer">the JMeter one</a> and the additional YAML I'm adding is as below:</p>
<pre class="lang-yaml prettyprint-override"><code>- name: InfluxDB Storage Secret
  k8s:
    apiVersion: v1
    kind: Secret
    type: Opaque
    metadata:
      name: azure-storage-account-infxluxdb-secret
      namespace: '{{ meta.namespace }}'
    stringData:
      azurestorageaccountname: 'xxxxxxx'
      azurestorageaccountkey: 'xxxxxxxxxxx'
</code></pre>
<p>Is there anything wrong with the YAML definition? I'm modifying the <em>roles/jmeter/tasks/main.yaml</em> of the role to add it into my specific namespace.</p>

David C
<p>Here is my example, that works for me, hope it help.</p>
<pre><code>  - name: CREATE MONGOSECRETS SECRET
    kubernetes.core.k8s:
      state: present
      definition: 
        apiVersion: v1
        kind: Secret
        type: Opaque             
        metadata:
          name: &quot;{{ secret_name }}&quot;
          namespace: &quot;{{ project_name | lower }}&quot;     
        data:
          config_data.json: &quot;{{ lookup('template', mongo_conn_templates_path + '/config_data.json' ) | tojson | b64encode }}&quot;
</code></pre>
