-
Notifications
You must be signed in to change notification settings - Fork 0
/
useradd.yml
55 lines (51 loc) · 1.23 KB
/
useradd.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- name: AnsiblePlayBook.
hosts: localhost
become: true
vars_files:
- var_filename
become_user: root
tasks:
- name: create Application user group.
group:
name: "{{ item.groupname }}"
gid: "{{ item.group }}"
state: present
tags:
- group add
- name: Add Application Users
ansible.builtin.user:
name: "{{ item.users }}"
uid: "{{ item.uid }}"
group: "{{ item.group }}"
create_home: true
home: /opt/users
comment: "Application User"
shell: /bin/bash
state: present
loops:
- "{userdata}"
tags:
- useradd
- name: create folder structre.
ansible.builtin.file:
path: '/opt/apps/{{ item.path }}/'
state: directory
owner: "{{ item.users }}"
group: "{{ item.group }}"
mode: 0775
recurse: true
loop:
- {path: data}
- {path: data01}
tags:
- directory create.
- name: Installing OpenJDK and httpd.
yum:
name:
- java-1.8.0-openjdk
- httpd
- mysqld
state: present
- name: java version
command: "java -version"