mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 13:32:10 +00:00
ipahost: Return generated random password
The random password is only returned if random is yes and the host did
not exist or update_password is yes.
If only one host is handled by the module, the returned dict is containing
this dict:
{ "randompassword": "<the host random password>" }
If several hosts are handled by the module (future feature):
{ "<host>": { "randompassword": "<the host random password>" } }
Fixes issue #134 (ipahost does not return the random password)
This commit is contained in:
18
playbooks/host/ensure_host_with_randompassword.yml
Normal file
18
playbooks/host/ensure_host_with_randompassword.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Ensure host with random password
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Host "{{ 'host1.' + ipaserver_domain }}" present with random password
|
||||
ipahost:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: "{{ 'host1.' + ipaserver_domain }}"
|
||||
random: yes
|
||||
force: yes
|
||||
update_password: on_create
|
||||
register: ipahost
|
||||
|
||||
- name: Print generated random password
|
||||
debug:
|
||||
var: ipahost.host.randompassword
|
||||
Reference in New Issue
Block a user