0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

molecule.ymlにinventoryで設定している値を取り込む方法の検討(検討中)

Posted at

TBD(検討中)

test-kitchenではkitchen.ymlにおいてerbテンプレートエンジンが使えたので、外部から構造化された値を取り込んで利用できた。
moleculeで同様の事を行うにはどうすれば良いか。

環境変数

環境変数は参照して使用できる様子。
https://molecule.readthedocs.io/en/latest/configuration.html#variable-substitution

しかし環境変数では構造化されたデータを扱うことは困難か。
フロースタイルYAMLなどとして1行にして連携すればできない事もないか。。

moleculeコマンドへの引数

引数をわたせる様子

# molecule --env-file foo.yml converge

プロセス置換がつかえるシェルなら、一時ファイルを使用せずにインベントリーの内容を連携できそう

# molecule --env-file <(ansible-inventory -i ../../inventory --yaml --list) converge
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?