Ansible Module - Users and Groups

CodingDaddy·2022년 3월 19일
0

Ansible -Study

목록 보기
11/11
post-thumbnail

ansible-user-doc

  • expire user accout: expires

create a user named admin with group: admin and uid: 2048

- hosts: all
  gather_facts: no
  tasks:
    - group:
      name: admin
  - user:
      name: admin
      group: admin
      uid: 2048

Create a user account with username testman that would be expiring after 3 years. The expires option on the users module is in the epoch. So Sunday, December 31, 2023 11:59:59 PM GMT== 1704067199 as epoch time

- hosts: all
  gather_facts: no
  tasks:
    - user:
        name: 'testman'
        expires: 1704067199

사용자 계정, 그룹 삭제

- hosts: all
  gather_facts: no
  tasks:
    - user:
        name: 'admin'
        state: absent
    - group:
        name: 'admin'
        state: absent
profile
Creative - DevOps in Korea

0개의 댓글