Skip to content

Instantly share code, notes, and snippets.

@konstruktoid
Created October 11, 2022 19:49
Show Gist options
  • Save konstruktoid/961599dd311fae3ae07947655d0bdaaf to your computer and use it in GitHub Desktop.
Save konstruktoid/961599dd311fae3ae07947655d0bdaaf to your computer and use it in GitHub Desktop.
---
- hosts: localhost
tasks:
- name: 8 character random string
ansible.builtin.set_fact:
generated_password: "{{ lookup('community.general.random_string', min_lower=1, min_upper=1, min_special=1, min_numeric=1) }}"
register: password
- name: print registered password
debug:
msg: "{{ password }}"
- name: print password fact
debug:
msg: "{{ generated_password }}"
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment