22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ansibleでユーザのパスワード設定変更を自動化する

Last updated at Posted at 2016-05-22

Ansibleを使ってユーザのパスワードを一括して変更したい場合、
以前はユーザのパスワードは平文ではなくハッシュ化した値が必要でしたが
password_hash()を使えばplaybookに平文でパスワードの作成ができます。

playbookに書く

playbook.yml
- hosts: ホスト名を指定
  tasks:
    - name: "rootユーザーのパスワードを変更"
      user:
        name: "root"
        password: "{{ 'パスワードを指定'|password_hash('sha512') }}"

たったこれだけです。

22
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
25

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?