github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/commands/sentinel/apply.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: sentinel apply'
     4  description: >
     5    The sentinel apply command is used to write a new, or update an existing,
     6    Sentinel policy.
     7  ---
     8  
     9  # Command: sentinel apply
    10  
    11  The `sentinel apply` command is used to write a new, or update an existing,
    12  Sentinel policy.
    13  
    14  ~> Sentinel commands are new in Nomad 0.7 and are only available with Nomad
    15  Enterprise.
    16  
    17  ## Usage
    18  
    19  ```plaintext
    20  nomad sentinel apply [options] <Policy Name> <Policy File>
    21  ```
    22  
    23  The `sentinel apply` command requires two arguments, the policy name and the
    24  policy file. The policy file can be read from stdin by specifying "-" as the
    25  file name.
    26  
    27  Sentinel commands are only available when ACLs are enabled. This command
    28  requires a management token.
    29  
    30  ## General Options
    31  
    32  @include 'general_options_no_namespace.mdx'
    33  
    34  ## Apply Options
    35  
    36  - `-description` : Sets a human readable description for the policy
    37  
    38  - `-scope` : (default: submit-job) Sets the scope of the policy and when it
    39    should be enforced.
    40  
    41  - `-level` : (default: advisory) Sets the enforcement level of the policy. Must
    42    be one of advisory, soft-mandatory, hard-mandatory.
    43  
    44  ## Examples
    45  
    46  Write a policy:
    47  
    48  ```shell-session
    49  $ nomad sentinel write -description "My test policy" foo test.sentinel
    50  Successfully wrote "foo" Sentinel policy!
    51  ```