From 636d37f5a3bf16180de7b7f0ae8b626aa9399303 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 1 Jun 2015 14:27:58 +0300 Subject: [PATCH] Add miscellaneous playbook to change the provisioning user's password Signed-off-by: Alan Orth --- misc-plays/change_password.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 misc-plays/change_password.yml diff --git a/misc-plays/change_password.yml b/misc-plays/change_password.yml new file mode 100644 index 0000000..8f7bcc3 --- /dev/null +++ b/misc-plays/change_password.yml @@ -0,0 +1,25 @@ +--- + +# One-off playbook to change login credentials for provisioning user. +# Generate a SHA-512 password hash using python and add it in the one +# of the included variable files for the host. +# +# using python: +# $ python -c 'import crypt; print crypt.crypt("Soylent Green Is People!", "$6$saltiness")' +# +# playbook execution: +# $ ansible-playbook misc_plays/change_password.yml -K --limit=$host_or_group +# + +- hosts: all + user: provisioning + sudo: yes + vars_files: + - "../vars/{{ ansible_distribution }}.yml" + + tasks: + - name: Set password, shell, homedir for provisioning user + when: provisioning_user is defined + user: name={{ provisioning_user.name }} password={{ provisioning_user.password }} shell={{ provisioning_user.shell }} state={{ provisioning_user.state }} createhome=no + +# vim: set sw=2 ts=2: