forked from TOSIT-IO/tdp-getting-started
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-users.yml
51 lines (47 loc) · 1.57 KB
/
deploy-users.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
---
- name: "Add defined users"
hosts: edge
strategy: linear # Do not use Mitogen
tasks:
- include_role:
name: ansible_roles/collections/ansible_collections/tosit/tdp-extra/roles/ansible-hadoop-user
vars:
ldap_admin_dn: cn=Manager,ou=tdp,o=tosit,c=io
ldap_admin_pwd: secret
ldap_group_base: ou=groups,c=io
ldap_user_base: ou=users,c=io
user: "{{ item.user }}"
password: "{{ item.password }}"
group: "{{ item.group }}"
uid: "{{ item.uid }}"
gid: "{{ item.gid }}"
with_items: "{{ users }}"
- import_playbook: ansible_roles/collections/ansible_collections/tosit/tdp/playbooks/ranger_usersync_restart.yml
- name: Create HDFS access policies in Ranger
hosts: ranger_admin[0]
become: yes
tasks:
- include_role:
name: ansible_roles/collections/ansible_collections/tosit/tdp-extra/roles/ansible-tdp-common-actions
tasks_from: deploy-ranger-hdfs-policy
with_items:
- "{{ user_hdfs_policies }}"
- name: Create Hive access policies in Ranger
hosts: ranger_admin[0]
become: yes
tasks:
- include_role:
name: ansible_roles/collections/ansible_collections/tosit/tdp-extra/roles/ansible-tdp-common-actions
tasks_from: deploy-ranger-hive-policy
with_items:
- "{{ user_hive_policies }}"
- hosts: edge-01
tasks:
- name: Deploy users' ssh
include_role:
name: ansible_roles/collections/ansible_collections/tosit/tdp-extra/roles/ansible-ssh-deployment
vars:
owner: "{{ item.user }}"
with_items:
- "{{ users }}"
tags: ssh