回答編集履歴

2

文章の修正

2020/05/09 16:40

投稿

comefigo
comefigo

スコア1045

test CHANGED
@@ -80,8 +80,8 @@
80
80
 
81
81
  理解されているかと思いますが、一応変数の指定方法について補足
82
82
 
83
- templates.server2[0]はtemplates.server2のtest1.txtを指定することができます。
83
+ templates.server2[0]はtemplates.server2のtest1.txtを指ます。
84
84
 
85
- templates['server2'][0]も同じようにtemplates.server2のtest1.txtを指ています。
85
+ templates['server2'][0]も同じようにtemplates.server2のtest1.txtを指します。
86
86
 
87
- 上記のようにホスト名が動的な場合は、templates.変数名ではなくtemplates[変数名]で指定しかない
87
+ 上記のようにホスト名が動的な場合(ansible_facts['nodename'])は、templates.変数名ではなくtemplates[変数名]で指定します

1

ansibleバージョンを追記

2020/05/09 16:40

投稿

comefigo
comefigo

スコア1045

test CHANGED
@@ -3,6 +3,8 @@
3
3
 
4
4
 
5
5
  ファイル名が固定値ならば一番手っ取り早い方法としては、以下になります。
6
+
7
+ 一応ansible 2.9.7で動作確認済みです。
6
8
 
7
9
 
8
10