<p><strong>Hello!</strong></p>
<p>I tired to create some playbook for deploying &quot;AWX Operator&quot; and Kubernetes using manual of installation <a href="https://computingforgeeks.com/how-to-install-ansible-awx-on-ubuntu-linux/#comment-8810" rel="nofollow noreferrer">Install AWX Operator</a></p>
<p>I have the command:</p>
<pre><code>export NAMESPACE=awx
kubectl create ns ${NAMESPACE}
</code></pre>
<p>I created tasks:</p>
<pre><code>- name: Echo export NAMESPACE awx
  shell: &quot;export NAMESPACE=awx&quot;
  environment:
    NAMESPACE: awx

- name: my_env_var 
  shell: &quot;kubectl create ns NAMESPACE&quot;
</code></pre>
<p>But I get an error:</p>
<pre><code>fatal: [jitsi]: FAILED! =&gt; {&quot;changed&quot;: true, &quot;cmd&quot;: &quot;kubectl create ns NAMESPACE&quot;, &quot;delta&quot;: &quot;0:00:00.957414&quot;, &quot;end&quot;: &quot;2021-10-22 13:25:16.822714&quot;, &quot;msg&quot;: &quot;non-zero return code&quot;, &quot;rc&quot;: 1, &quot;start&quot;: &quot;2021-10-22 13:25:15.865300&quot;, &quot;stderr&quot;: &quot;The Namespace \&quot;NAMESPACE\&quot; is invalid: metadata.name: Invalid value: \&quot;NAMESPACE\&quot;: a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')&quot;, &quot;stderr_lines&quot;: [&quot;The Namespace \&quot;NAMESPACE\&quot; is invalid: metadata.name: Invalid value: \&quot;NAMESPACE\&quot;: a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')&quot;], &quot;stdout&quot;: &quot;&quot;, &quot;stdout_lines&quot;: []}
</code></pre>
<p>Could you please help me with advice? <strong>Thank you.</strong></p>

Oleg
<p>You have everything written in this error :)</p>
<p><strong>There is a problem with the command</strong></p>
<pre class="lang-yaml prettyprint-override"><code>kubectl create ns NAMESPACE
</code></pre>
<p>You want to create a namespace called <code>NAMESPACE</code> which is wrong. <strong>You cannot use capital letters in the name of the namespace.</strong> You can get hint from this message:</p>
<pre class="lang-yaml prettyprint-override"><code>Invalid value: \&quot;NAMESPACE\&quot;: a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc'
</code></pre>
<p>How to solve it? You need to change this line:</p>
<pre class="lang-yaml prettyprint-override"><code>shell: &quot;kubectl create ns NAMESPACE&quot;
</code></pre>
<p>You need to proper set your namespace without capital letters.</p>
<p><strong>Examples:</strong></p>
<pre class="lang-yaml prettyprint-override"><code>shell: &quot;kubectl create ns my-namespace&quot;
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>shell: &quot;kubectl create ns my-name&quot;
</code></pre>
<pre class="lang-yaml prettyprint-override"><code>shell: &quot;kubectl create ns whatever-you-want&quot;
</code></pre>
