{"id":1976,"date":"2015-06-01T11:23:18","date_gmt":"2015-06-01T02:23:18","guid":{"rendered":"http:\/\/blog.rutake.com\/techmemo\/?p=1976"},"modified":"2015-06-01T11:28:57","modified_gmt":"2015-06-01T02:28:57","slug":"ansible-%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%82%92%e5%85%83%e3%81%ab%e5%a4%89%e6%95%b0%e3%82%92%e5%9f%8b%e3%82%81%e3%81%a6%e3%82%b3%e3%83%94%e3%83%bc%e3%81%99%e3%82%8btemplate","status":"publish","type":"post","link":"https:\/\/blog.rutake.com\/techmemo\/2015\/06\/01\/ansible-%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%82%92%e5%85%83%e3%81%ab%e5%a4%89%e6%95%b0%e3%82%92%e5%9f%8b%e3%82%81%e3%81%a6%e3%82%b3%e3%83%94%e3%83%bc%e3%81%99%e3%82%8btemplate\/","title":{"rendered":"Ansible \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u5143\u306b\u5909\u6570\u3092\u57cb\u3081\u3066\u30b3\u30d4\u30fc\u3059\u308btemplate\u30e2\u30b8\u30e5\u30fc\u30eb"},"content":{"rendered":"<p>template\u30e2\u30b8\u30e5\u30fc\u30eb\u81ea\u4f53\u306f\u30d5\u30a1\u30a4\u30eb\u30b3\u30d4\u30fc\u3068\u307b\u307c\u540c\u3058\u306a\u306e\u3060\u304c\u3001\u5909\u6570\u90e8\u5206\u3092\u7f6e\u63db\u5f8c\u306b\u30b3\u30d4\u30fc\u3059\u308b\u3068\u3044\u3046\u306e\u304c\u9055\u3044\u3002<\/p>\n<p>template\u30bf\u30b9\u30af\u306e\u8a18\u8f09\u4f8b\u306f\u3042\u308b\u306e\u3060\u304c\u3001\u7f6e\u63db\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8a18\u8f09\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3042\u307e\u308a\u306a\u304b\u3063\u305f\u3088\u3046\u306a\u306e\u3067\u3042\u3052\u3066\u307f\u305f\u3002<\/p>\n<p>\u4e0b\u8a18\u4f8b\u306f\/etc\/hosts\u306b\u5909\u6570hostname\u306b\u5b9a\u7fa9\u3057\u305f\u5024\u3092\u5c55\u958b\u3057\u3066\u304b\u3089\u3001\u30b3\u30d4\u30fc\u3059\u308b\u30bf\u30b9\u30af\u3002\u5b9f\u65bd\u6761\u4ef6\u3068\u3057\u3066hostname\u5909\u6570\u304c\u3042\u308b\u3053\u3068\u3082\u5165\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>[shell]<br \/>\n# hosts<br \/>\n&#8211; name: \/etc\/hosts setup<br \/>\n  template: src=hosts.j2 dest=\/etc\/hosts<br \/>\n  when: hostname is defined<br \/>\n[\/shell]<\/p>\n<p>hosts.j2\u306e\u8a18\u8f09\u306f\u7f6e\u63db\u90e8\u5206\u3092ansible\u3068\u540c\u3058\u3088\u3046\u306b{{ \u5909\u6570\u540d }} \u3067\u8a18\u8f09\u3057\u3066\u304a\u304f\u3002<\/p>\n<p>[shell]<br \/>\n127.0.0.1   {{ hostname }}.localdomain {{ hostname }} localhost localhost.localdomain<br \/>\n[\/shell]<\/p>\n<p>\u4e0a\u8a18\u306e\u5834\u5408\u306fhostname\u5909\u6570\u304c\u5c55\u958b\u3055\u308c\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>template\u30e2\u30b8\u30e5\u30fc\u30eb\u81ea\u4f53\u306f\u30d5\u30a1\u30a4\u30eb\u30b3\u30d4\u30fc\u3068\u307b\u307c\u540c\u3058\u306a\u306e\u3060\u304c\u3001\u5909\u6570\u90e8\u5206\u3092\u7f6e\u63db &hellip; <a href=\"https:\/\/blog.rutake.com\/techmemo\/2015\/06\/01\/ansible-%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%82%92%e5%85%83%e3%81%ab%e5%a4%89%e6%95%b0%e3%82%92%e5%9f%8b%e3%82%81%e3%81%a6%e3%82%b3%e3%83%94%e3%83%bc%e3%81%99%e3%82%8btemplate\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[364],"tags":[365,369,368],"_links":{"self":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/1976"}],"collection":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/comments?post=1976"}],"version-history":[{"count":3,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/1976\/revisions"}],"predecessor-version":[{"id":1979,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/1976\/revisions\/1979"}],"wp:attachment":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/media?parent=1976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/categories?post=1976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/tags?post=1976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}