Valid since:
XL Release 8.6.0
XL Deploy 8.6.0
XL JetPack 8.6.0

You can specify and maintain global permissions, roles, and users for XL Deploy in YAML, enabling you to manage this aspect of your XL Deploy configuration “as code”.

Before you begin

In XL Deploy, you can assign internal users to roles that determine the global permissions that they have. Global permissions apply across the entire XL Deploy system.

You should familiarize yourself with how global permissions and roles work in XL Deploy:

Work with users

This section describes how to define internal users in YAML, view the results in the UI, and then generate YAML that reflects your configuration.

Define users in YAML

To support running the examples shown in this topic, define three users.

Create a YAML file with the following specification:

---
apiVersion: xl-deploy/v1
kind: Users
spec:
- username: chris_smith
  password: !value pass1
- username: jay_albert
  password: changeme
- username: sue_perez
  password: changeme

Save the file (e.g., create-users.yaml) and apply it to XL Deploy:

xl apply -f create-users.yaml

Go to UI and confirm the results.

XL Deploy Users

Generate YAML for users

You can generate a YAML file that specifies your users by using the xl generate command with the -u flag.

xl generate -f users.yaml -u

Example of output results:

---
apiVersion: xl-deploy/v1
kind: Users
spec:
- username: admin
- username: chris_smith
- username: jay_albert
- username: sue_perez

Note: The YAML output does not include the password information as it is encrypted.

Work with global roles

This section describes how to define global roles in YAML, view the results in the UI, and then generate a YAML file that reflects your configuration.

Define global roles in YAML

To support running the examples shown in this topic, define two roles (Leaders and Developers) with one or more users (referred to as principals) assigned to them.

Create a YAML file with the following specification:

---
apiVersion: xl-deploy/v1
kind: Roles
spec:
- name: Leaders
  principals:
  - jay_albert
- name: Developers
  principals:
  - ron_vallee
  - sue_perez

Save the file (e.g., create-roles.yaml) and apply it to XL Deploy:

xl apply -f create-roles.yaml

Go to UI and confirm the results.

XL Deploy Roles

Generate YAML for global roles

To generate YAML for your existing global role configuration to a file called roles.yaml, add the -r flag:

xl generate -f roles.yaml -r

Result:

---
apiVersion: xl-deploy/v1
kind: Roles
spec:
- name: leaders
  principals:
  - jay_albert
- name: developers
  principals:
  - ron_vallee
  - sue_perez

Work with global permissions

This section describes how to define global permissions and view the results in the UI. It also describes how to generate a YAML file specifying your global permissions.

Define global permissions in YAML

Similar to roles, you can define global permissions in YAML and apply to XL Deploy.

To define global permissions, create a YAML file and assign specific permissions to each role (Leaders and Developers).

This example grants all available permissions for the Developers role and limits the Leaders role to two permissions:

---
apiVersion: xl-deploy/v1
kind: Permissions
spec:
- global:
  - role: Leaders
    permissions:
    - report#view
    - task#assign
  - role: Developers
    permissions:
    - task#skip_step
    - admin
    - login
    - task#takeover
    - task#preview_step
    - report#view
    - discovery
    - controltask#execute
    - task#assign
    - task#view
    - task#move_step
    - security#edit

Save the file (e.g., global-perms.yaml) and apply it to XL Deploy:

xl apply -f global-perms.yaml

Review the results in the UI:

MyFolder

Generate YAML for global permissions

Generate YAML for your existing global permissions configuration to a file called permissions.yaml, add the -g flag:

xl generate -f permissions.yaml -g