53 lines
1.3 KiB
Plaintext
53 lines
1.3 KiB
Plaintext
---
|
|
layout: docs
|
|
page_title: 'Commands: sentinel apply'
|
|
sidebar_title: apply
|
|
description: >
|
|
The sentinel apply command is used to write a new, or update an existing,
|
|
Sentinel policy.
|
|
---
|
|
|
|
# Command: sentinel apply
|
|
|
|
The `sentinel apply` command is used to write a new, or update an existing,
|
|
Sentinel policy.
|
|
|
|
~> Sentinel commands are new in Nomad 0.7 and are only available with Nomad
|
|
Enterprise.
|
|
|
|
## Usage
|
|
|
|
```plaintext
|
|
nomad sentinel apply [options] <Policy Name> <Policy File>
|
|
```
|
|
|
|
The `sentinel apply` command requires two arguments, the policy name and the
|
|
policy file. The policy file can be read from stdin by specifying "-" as the
|
|
file name.
|
|
|
|
Sentinel commands are only available when ACLs are enabled. This command
|
|
requires a management token.
|
|
|
|
## General Options
|
|
|
|
@include 'general_options_no_namespace.mdx'
|
|
|
|
## Apply Options
|
|
|
|
- `-description` : Sets a human readable description for the policy
|
|
|
|
- `-scope` : (default: submit-job) Sets the scope of the policy and when it
|
|
should be enforced.
|
|
|
|
- `-level` : (default: advisory) Sets the enforcement level of the policy. Must
|
|
be one of advisory, soft-mandatory, hard-mandatory.
|
|
|
|
## Examples
|
|
|
|
Write a policy:
|
|
|
|
```shell-session
|
|
$ nomad sentinel write -description "My test policy" foo test.sentinel
|
|
Successfully wrote "foo" Sentinel policy!
|
|
```
|