2017-09-19 14:47:10 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "Commands: sentinel apply"
|
|
|
|
sidebar_current: "docs-commands-sentinel-apply"
|
|
|
|
description: >
|
2019-10-22 13:44:00 +00:00
|
|
|
The sentinel apply command is used to write a new, or update an existing,
|
|
|
|
Sentinel policy.
|
2017-09-19 14:47:10 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Command: sentinel apply
|
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
The `sentinel apply` command is used to write a new, or update an existing,
|
|
|
|
Sentinel policy.
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2018-03-22 20:39:18 +00:00
|
|
|
~> Sentinel commands are new in Nomad 0.7 and are only available with Nomad
|
|
|
|
Enterprise.
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
## Usage
|
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
```plaintext
|
2017-09-19 14:47:10 +00:00
|
|
|
nomad sentinel apply [options] <Policy Name> <Policy File>
|
|
|
|
```
|
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
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.
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
## General Options
|
|
|
|
|
|
|
|
<%= partial "docs/commands/_general_options" %>
|
|
|
|
|
|
|
|
## Apply Options
|
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
- `-description` : Sets a human readable description for the policy
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
- `-scope` : (default: submit-job) Sets the scope of the policy and when it
|
|
|
|
should be enforced.
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
- `-level` : (default: advisory) Sets the enforcement level of the policy. Must
|
|
|
|
be one of advisory, soft-mandatory, hard-mandatory.
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
Write a policy:
|
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
```shell
|
2017-09-19 14:47:10 +00:00
|
|
|
$ nomad sentinel write -description "My test policy" foo test.sentinel
|
|
|
|
Successfully wrote "foo" Sentinel policy!
|
|
|
|
```
|