From 080c784f4bbdeb1a8ffce6f9cc24b92c3f700a1c Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Fri, 13 Oct 2023 13:30:12 +0200 Subject: [PATCH] solution --- playbook.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 playbook.yml diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..9c2bd74 --- /dev/null +++ b/playbook.yml @@ -0,0 +1,10 @@ +--- +- hosts: centos1.formation.opendoor.fr + tasks: + - name: create account + vars: + password: "{{ lookup('ansible.builtin.password', '/tmp/userpassword', length=14, seed=inventory_hostname, chars=['ascii_letters', 'digits', 'punctuation']) }}" + ansible.builtin.user: + user: foobar + password: "{{ password | password_hash( 'sha512', 1234 | random( seed=inventory_hostname )) }}" + shell: /bin/bash \ No newline at end of file