Travel

Ansible user create

– hosts: localhost
 remote_user: user
 become: yes

 vars:
 test_user: testuser
 test_group: testgroup
 test_user_password: somepassword

 tasks:
 – name: Creating Group for testuser
 group:
 name: “{{ test_group }}”
 state: present

 – name: Creating testuser
 user:
 name: “{{ test_user }}”
 password: “{{ test_user_password | password_hash(‘sha512’) }}”
 shell: /bin/bash
 group: “{{ test_group }}”
 update_password: on_create ansible 에서 user 생성시 …

Continue Reading