-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecops.yml
32 lines (29 loc) · 963 Bytes
/
secops.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#Use below command to get Encrypt password
- hosts: all
tasks:
- name: Create user
user: name=secops comment="Information Security" shell=/bin/bash
# - name: Locking Password
# command: 'passwd –l secops'
- file:
path: /home/secops/.ssh
owner: secops
group: secops
mode: 0700
state: directory
- copy:
src: authorized_keys
dest: /home/secops/.ssh/
owner: secops
group: secops
mode: 0600
- name: Sudoers | update sudoers file and validate
lineinfile: "dest=/etc/sudoers
insertafter=EOF
line='#Information Security- This Entry and ID can delete after somedays'
state=present"
- name: Sudoers | update sudoers file and validate
lineinfile: "dest=/etc/sudoers
insertafter=EOF
line='secops ALL=(ALL) NOPASSWD: ALL'
state=present"