LoginSignup
0
0

More than 3 years have passed since last update.

AnsibleTower workflow内のjob間で変数を引き継ぐ

Last updated at Posted at 2020-05-08

はじめに

AnsibleTowerでワークフローを利用していると、後続のジョブに前のジョブの結果を引き渡したいことがある
ついついset_factで変数を定義して引き継ごうとしてしまうが、これだと別のジョブへは変数を引き渡すことができない

対策

set_statsで変数を定義することで、後続のジョブに変数を渡すことができる

以下の例でpersistent_variableが引き継ぎされる

  - name: "Set variable"
    set_stats:
      data:
        persistent_variable:  "<data>"

参照

公式ドキュメントに答えがあった
Workflows: https://docs.ansible.com/ansible-tower/latest/html/userguide/workflows.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0