Thanks, thats work, bud i have another problem. Here is my code. If i loop
more than 2, how can i these 2(and more) results, pass to file. it only
pass 1.
- gather_facts: false
hosts: localhost
tasks:
- set_fact:
db: "{{ lookup('password', '/dev/null chars=ascii_letters,digits
length=32') }}"
usr: "{{ lookup('password', '/dev/null chars=ascii_letters,digits
length=39') }}"
password: "{{ lookup('password', '/dev/null chars=ascii_letters,digits
length=21') + '' }}"
with_sequence: end={{ number }}
- local_action: shell echo "{{ db }}__{{ usr }} {{ db }} {{ password }}" >>
/tmp/pass_pokus3
Dne středa 20. března 2019 17:16:29 UTC+1 Kai Stian Olstad napsal(a):
>
> On 20.03.2019 15:30, Jakub Kafka wrote:
> > i have question. Can i specify number of loops from command line
> > --extra_vars? II want specify number of password to be generated.
>
> Of course, with variables you can do almost everyting.
>
> - debug: var=item
> with_sequence: end={{ number }}
>
>
> ansible-playbook -e number=3
>
>
> --
> Kai Stian Olstad
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/8d132c6f-b357-4470-bd60-8cbc2edda221%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.