承認ポイント

誰かが承認するまでジョブを一時停止する

  1. しくみ
  2. 自分のジョブを承認する
  3. 属性
  4. 例
    1. 1) Remove host
    2. 2) Ask for approval in Teams

しくみ

承認ポイントは、承認者が応答するまで、フォーム内のその位置でジョブを一時停止します。

When you want to pause a job and ask for approval first. You can insert an approval point using the approval-object attributes


自分のジョブを承認する

7.3.0 以降、ジョブを起動したユーザーは、承認のロールのいずれかを持っていてもそのジョブを承認できないため、2 人目の確認が必要になります。管理者は、自分のジョブも含めて常に承認できます。 起動したユーザーは、自分のジョブを却下 (取り下げ) することはできます。起動したユーザーにも承認を許可する場合は、テスト用のフォームなどで allowSelf: true を設定します。

approval:
  title: Approve the change
  message: Please approve this change
  roles:
    - approvers
  allowSelf: true

属性

承認ポイントの属性:

属性 説明
title
string

Approval message title
Free text with placeholders

The approval point consists out of a title and message. This is the title attribute, used as the subject of the approval mail.
Without it, the mail gets the default approval subject. A workflow’s approval nodes take the node’s name as title.
Note: This supports placeholders (the placeholders point to extravars)

message
string / 必須

Approval message
Free text with placeholders

The approval point consists out of a title and message. This is the message attribute.
Note: This supports placeholders (the placeholders point to extravars)

roles
array / 必須

The approver roles
a valid role

Every role in this list will have the power to approve or reject this job.

notifications
array

The approval recipients
a valid email address

Every email-address in this list will receive the approval message by email with the approval link.

channels
array

The approval channels
the name of a notification channel

The notification channels of Connections > Notifications that receive the approval message, with a link to the job, where it is approved or rejected: Slack, Microsoft Teams, Telegram, a webhook.
A mail channel in this list sends the approval mail to the notifications addresses through that server instead of the active one.
A name that is not there is said in the log and skipped. (Added in 7.0.0)

allowSelf
boolean

The requester may approve their own job
true or false

By default the user who launched a job cannot approve it, even with one of the approver roles: another approver must, so every approved job was seen by two people. The requester can still reject (withdraw) their own job. Set allowSelf: true to let the requester approve their own job too. An admin can always approve any job, their own included, whatever this says. (Added in 7.3.0)


例

承認ポイントの YAML での例です。

1) Remove host

YAML での定義です。

approval:
  title: Remove host $(vm.name) ?
  message: |
    You are about to remove vm $(vm.name).<br>
    Esx server: $(cluster.esxhost.name)<br>
    Status: $(vm.status)<br>
    Change request: $(cr.id)
  roles:
  - approvers
  - vmwareadmin
  notifications:
  - vmware@domain.local
  - approvers@domain.local      

2) Ask for approval in Teams

YAML での定義です。

approval:
  title: Remove host $(vm.name) ?
  message: You are about to remove vm $(vm.name).
  roles:
  - approvers
  channels:
  - approvers-teams