forked from brianehlert/ansible-nginx-controller-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx_controller_user_role.yaml
47 lines (43 loc) · 1.52 KB
/
nginx_controller_user_role.yaml
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
---
# ansible-playbook nginx_controller_user.yaml -i controller -e "[email protected] nginx_controller_password=userPassword"
# add users to nginx Controller
- hosts: localhost
tasks:
- name: Retrieve the NGINX Controller auth token
include_role:
name: nginxinc.nginx_controller_generate_token
# Define one user account
- name: Configure the user
include_role:
name: nginxinc.nginx_controller_user_role
vars:
nginx_controller_user_role:
metadata:
name: "lending-admin"
displayName: "Lending Admin Access"
description: "This role grants users Admin priv's to all Lending Environments"
desiredState:
permissions:
-
path: "/services/environments/lending-prod"
access: "FULL"
-
path: "/services/environments/lending-dev"
access: "FULL"
-
path: "/services/environments/retail-prod"
access: "NONE"
-
path: "/services/environments/retail-dev"
access: "NONE"
# # Define an array of user accounts
# - name: read the user array
# include_vars:
# file: "nginx_controller_user_role_vars.yaml"
# name: roles
# - name: Configure array of users
# include_role:
# name: nginxinc.nginx_controller_user_role
# vars:
# nginx_controller_user: "{{ item }}"
# with_items: "{{ roles.roles }}"