title: How to select mandatory character when generating random password with ansible?
body: <p>I create a random password with Ansible. <strong>4 characters in length</strong>. </p>
  
  <pre><code>- hosts: localhost
    vars:
      pwd_alias: "{{ lookup('password', '/dev/null length=4 chars=ascii_letters,digits,hexdigits,punctuation' ) }}"
  
    user: root
    tasks:
      - debug:
          msg: Sifre= {{pwd_alias}}
  
      - debug:
          msg: Sifre= {{pwd_alias}}
  
      - debug:
          msg: Sifre= {{pwd_alias}}
  
      - debug:
          msg: Sifre= {{pwd_alias}} 
  </code></pre>
  
  <p>I want it to be password  example. <strong>I want the output to look like this example.</strong></p>
  
  <pre><code>TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= Z/bO"
  }
  
  TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= a_4G"
  }
  
  TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= 9a&amp;0"
  }
  
  TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= d.2C"
  }
  </code></pre>
  
  <ol>
  <li><p>ascii_letters = 1</p></li>
  <li><p>hexdigits = 1</p></li>
  <li><p>digits = 1</p></li>
  <li><p>punctuation = 1</p></li>
  </ol>
  
  <p>I want him to generate a random password like this. But what the system produces sometimes changes. Sometimes there are no digits, sometimes there is no punctuation. I want these 4 features to be absolutely.</p>
  
  <p>￼
  ansible version =  2.7.10</p>
  
  <p>This is how the outputs are</p>
  
  <pre><code>TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= Z/bh"
  }
  
  TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= a_-G"
  }
  
  TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= 9ad0"
  }
  
  TASK [debug] 
  ok: [localhost] =&gt; {
      "msg": "Sifre= d.aC"
  }
  </code></pre>
  
  <p><strong>How do I get each character? Thank you so much</strong></p>