# Passwd

Simple playbook for changing the password of the running user.


# Password changing playbook

Usage:

ansible-playbook updatepass.yml
---
- hosts: all
  gather_facts: yes
  vars_prompt:
    - name: "passwdinput"
      prompt: "Enter current password"
      private: yes
    - name: "passwdinputnew"
      prompt: "Enter new password"
      private: yes
  tasks:
    - name: Set Password
      expect:
        command: "passwd"
        responses:
          \(current\) UNIX password: "{{ passwdinput }}"
          Enter new UNIX password: "{{ passwdinputnew }}"
          Retype new UNIX password: "{{ passwdinputnew }}"
...
Last Updated: 2021/03/31 12:28+00:00