{"id":3396,"date":"2021-10-31T07:58:33","date_gmt":"2021-10-30T22:58:33","guid":{"rendered":"https:\/\/www.wetch.co.jp\/?p=3396"},"modified":"2022-01-14T11:43:23","modified_gmt":"2022-01-14T02:43:23","slug":"ansible%e3%81%a7git","status":"publish","type":"post","link":"https:\/\/www.wetch.co.jp\/note\/ansible%e3%81%a7git\/","title":{"rendered":"Ansible\u3067Git"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ansible\u306fIaC\uff08Infrastructure as Code\uff09\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3067\u3001\u3042\u3089\u304b\u3058\u3081Playbook\u3068\u547c\u3070\u308c\u308b\u30d5\u30a1\u30a4\u30eb\u306b\u5b9a\u7fa9\u3057\u305f\u5185\u5bb9\u306b\u5f93\u3063\u3066\u30b5\u30fc\u30d0\u74b0\u5883\u306e\u69cb\u7bc9\uff08\u30bd\u30d5\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084\u8a2d\u5b9a\u306a\u3069\uff09\u3092\u30d0\u30c3\u30c1\u7684\u306b\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uff11\u3064\u306e\u30d7\u30ed\u30c0\u30af\u30c8\u306b\u95a2\u3059\u308b\u30b5\u30fc\u30d0\u74b0\u5883\u69cb\u7bc9\u306f\u3001\u901a\u5e38\u306f\u8907\u6570\u53f0\uff08\u8907\u6570\u56de\uff09\u306b\u6e21\u3063\u3066\u884c\u308f\u308c\u307e\u3059\u3002\u6700\u4f4e\u9650\u3001\u958b\u767a\u6642\u306e\u52d5\u4f5c\u691c\u8a3c\u74b0\u5883\u3068\u672c\u756a\u904b\u7528\u74b0\u5883\u306f\u5225\u30b5\u30fc\u30d0\u4e0a\u306b\u69cb\u7bc9\u3057\u307e\u3059\u3057\u3001\u8ca0\u8377\u5206\u6563\u3092\u884c\u3046\u5834\u5408\u306f\u672c\u756a\u904b\u7528\u74b0\u5883\u3068\u3057\u3066\u8907\u6570\u53f0\u306e\u30b5\u30fc\u30d0\u306b\u540c\u3058\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002\u4e07\u304c\u4e00\u3001\u904b\u7528\u3057\u3066\u3044\u305f\u30b5\u30fc\u30d0\u3067\u30ea\u30ab\u30d0\u30ea\u56f0\u96e3\u306a\u969c\u5bb3\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u6025\u907d\u5225\u306e\u30b5\u30fc\u30d0\u4e0a\u306b\u74b0\u5883\u3092\u518d\u69cb\u7bc9\u3059\u308b\u5fc5\u8981\u304c\u751f\u3058\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u3088\u3046\u306b\u30b5\u30fc\u30d0\u74b0\u5883\u69cb\u7bc9\u30c4\u30fc\u30eb\u306f\u8907\u6570\u53f0\u306e\u5bfe\u8c61\u30b5\u30fc\u30d0\u306e\u5b58\u5728\u3092\u60f3\u5b9a\u3059\u308b\u305f\u3081\u3001\u901a\u5e38\u306f\u5f53\u8a72\u30bd\u30d5\u30c8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u74b0\u5883\u69cb\u7bc9\u7528\u30de\u30b7\u30f3\u304b\u3089\u5bfe\u8c61\u30b5\u30fc\u30d0\u306b\u5bfe\u3057\u3066\u901a\u4fe1\u3092\u4ecb\u3057\u3066\u5fc5\u8981\u306a\u64cd\u4f5c\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u6642\u3001\u540c\u5206\u91ce\u306e\u4ed6\u306e\u30bd\u30d5\u30c8\u3067\u306f\u901a\u4fe1\u3092\u884c\u3046\u305f\u3081\u306e\u76f8\u624b\u5074\u30bd\u30d5\u30c8\uff08\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\uff09\u3092\u5bfe\u8c61\u30b5\u30fc\u30d0\u5074\u306b\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u304c\u3001Ansible\u306f\u305d\u306e\u5fc5\u8981\u304c\u306a\u304f\u3001\u74b0\u5883\u69cb\u7bc9\u7528\u30de\u30b7\u30f3\u304b\u3089\u5bfe\u8c61\u30b5\u30fc\u30d0\u306bSSH\u3067\u30ed\u30b0\u30a4\u30f3\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u308c\u3070\u826f\u3044\u3060\u3051\u3067\u3059\u3002<br>\u3053\u306e\u8fba\u306e\u304a\u624b\u8efd\u3055\u304cAnsible\u306e\u9577\u6240\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306fAnsible\u306e\u4f7f\u3044\u65b9\u306b\u95a2\u3057\u3066\u66f8\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u30b5\u30fc\u30d0\u74b0\u5883\u3092\u4e00\u304b\u3089\u69cb\u7bc9\u3059\u308b\u64cd\u4f5c\u306b\u95a2\u3057\u3066\u66f8\u3053\u3046\u3068\u601d\u3046\u3068\u8a18\u4e8b\u304c\u5de8\u5927\u306b\u306a\u308b\u306e\u3067\u3001\u76ee\u7684\u3092\u9650\u5b9a\u3057\u3001Git\u3067\u7ba1\u7406\u3055\u308c\u305f\u30d7\u30ed\u30c0\u30af\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304a\u3088\u3073\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092Ansible\u3067\u884c\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u624b\u9806\u3001\u3064\u307e\u308a\u306fAnsible\u3092\u30c7\u30d7\u30ed\u30a4\u30c4\u30fc\u30eb\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u66f8\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Ansible\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u306fAnsible\u3092\u5b9f\u884c\u3067\u304d\u308b\u74b0\u5883\u69cb\u7bc9\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u540c\u74b0\u5883\u306f\u624b\u5143\u306ePC\u7b49\u3067\u3082\u69cb\u7bc9\u53ef\u80fd\u3067\u3059\u304c\u3001\u3067\u304d\u308c\u3070\u69d8\u3005\u306a\u30d7\u30ed\u30c0\u30af\u30c8\u3067\u6c4e\u7528\u7684\u306b\u5229\u7528\u3067\u304d\u308b\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u3044\u306e\u3067\u3001\u4eca\u56de\u306fAnsible\u3082\u30b5\u30fc\u30d0\u4e0a\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>\u305f\u3060\u3057\u3001\u3053\u306e\u30b5\u30fc\u30d0\u306fAnsible\u3067\u306e\u74b0\u5883\u69cb\u7bc9\u5bfe\u8c61\u3068\u306a\u308b\u30b5\u30fc\u30d0\u3068\u306f\u5225\u7269\u3067\u3001\u3042\u304f\u307e\u3067Ansible\u306e\u904b\u7528\u306b\u7279\u5316\u3057\u305f\u30b5\u30fc\u30d0\u3092\u610f\u5473\u3057\u307e\u3059\u3002<br>\u3088\u3063\u3066\u3001\u6df7\u540c\u3057\u306a\u3044\u3088\u3046\u3001Ansible\u3092\u904b\u7528\u3059\u308b\u30b5\u30fc\u30d0\u3092\u300cAnsible\u30b5\u30fc\u30d0\u300d\u3001Ansible\u306b\u3088\u308b\u74b0\u5883\u69cb\u7bc9\u306e\u5bfe\u8c61\u3068\u306a\u308b\u30b5\u30fc\u30d0\u3092\u300c\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u300d\u3068\u8868\u73fe\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ansible\u30b5\u30fc\u30d0\u306e\u69cb\u7bc9\u3067\u3059\u304c\u3001\u30b5\u30fc\u30d0OS\u3068\u3057\u3066\u306f\u73fe\u5728\u5f0a\u793e\u4e00\u63a8\u3057\u306eUbuntu\u3067\u8003\u3048\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002OS\u81ea\u4f53\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084\u5fc5\u8981\u306a\u8a2d\u5b9a\u306f\u672c\u8a18\u4e8b\u306e\u30c6\u30fc\u30de\u304b\u3089\u5916\u308c\u307e\u3059\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3088\u3063\u3066\u3001\u3044\u304d\u306a\u308aAnsible\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update\napt install software-properties-common\napt-add-repository --yes --update ppa:ansible\/ansible\napt install ansible<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7d30\u304b\u304f\u306f\u826f\u304f\u5206\u304b\u3089\u306a\u304f\u3066\u3082\u3001\u4e0e\u3048\u3089\u308c\u305f\u60c5\u5831\u3092\u5143\u306b\u546a\u6587\u306e\u3088\u3046\u306b\u5b9f\u884c\u3059\u308c\u3070\u671f\u5f85\u3057\u305f\u7d50\u679c\u304c\u5f97\u3089\u308c\u308b\u70b9\u304c\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u6a5f\u80fd\uff08apt\uff09\u306e\u826f\u3044\u3068\u3053\u308d\uff01<br>\u3053\u308c\u3067Ansible\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3078\u306e\u30a2\u30af\u30bb\u30b9\u8a2d\u5b9a<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u306b\u66f8\u304d\u307e\u3057\u305f\u3088\u3046\u306b\u3001Ansible\u3067\u306f\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u5fc5\u8981\u3068\u3057\u307e\u305b\u3093\u304c\u3001<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306bSSH\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u3088\u308b\u8a8d\u8a3c\u3082\u884c\u3048\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u3084\u306f\u308a\u3053\u3053\u306f\u516c\u958b\u9375\u8a8d\u8a3c\u306e\u65b9\u304c\u30b9\u30de\u30fc\u30c8\u3067\u3059\u3002<br>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u516c\u958b\u9375\u306e\u4f5c\u6210\u3068<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3078\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u306f\u3001Ansible\u30b5\u30fc\u30d0\u5074\u3067Ansible\u3092\u5b9f\u884c\u3059\u308b\u30e6\u30fc\u30b6\u3092\u6c7a\u3081\u307e\u3057\u3087\u3046\uff08\u79c1\u306e\u5834\u5408\u306f\u30d9\u30bf\u306b\u300cansible\u300d\u3068\u3044\u3046\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u304c\uff09\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306b\u540c\u30e6\u30fc\u30b6\u306e\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u300c.ssh\u300d\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u540c\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u305f\u5f8c\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen -t rsa<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u64cd\u4f5c\u306b\u3088\u308a\u3001.ssh\u914d\u4e0b\u306b\u300cid_rsa\u300d\u3068\u300cid_rsa.pub\u300d\u306e2\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\u524d\u8005\u304c\u79d8\u5bc6\u9375\u3001\u5f8c\u8005\u304c\u516c\u958b\u9375\u3067\u3059\u3002<br>\u3053\u306e\u516c\u958b\u9375\u306e\u65b9\u3092<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306b\u8ee2\u9001\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3067\u306f\u30d7\u30ed\u30c0\u30af\u30c8\u7ba1\u7406\u7528\u30e6\u30fc\u30b6\u306e\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u300c.ssh\u300d\u3092\u4f5c\u6210\u3057\u307e\u3059\uff08\u65e2\u306b\u4f5c\u6210\u6e08\u307f\u306e\u5834\u5408\u306f\u305d\u306e\u307e\u307e\u5229\u7528\uff09\u3002<br>\u540c\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u300cauthorized_keys\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u304c\u3001\u540c\u30d5\u30a1\u30a4\u30eb\u306f\u8907\u6570\u306e\u516c\u958b\u9375\u3092\u7ba1\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u65e2\u306b\u4ed6\u306e\u7528\u9014\u306b\u3088\u308b\u516c\u958b\u9375\u304c\u8a2d\u5b9a\u6e08\u307f\uff08<meta charset=\"utf-8\">authorized_keys\u4f5c\u6210\u6e08\u307f\uff09\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br>\u65e2\u5b58\u30c7\u30fc\u30bf\u3092\u6d88\u3057\u3066\u3057\u307e\u308f\u306a\u3044\u3088\u3046\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u4eca\u56de\u4f5c\u6210\u3057\u305f\u516c\u958b\u9375\u3092<meta charset=\"utf-8\">authorized_keys\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat id_rsa.pub &gt;&gt; authorized_keys<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u304a\u3001\u65b0\u898f\u306b<meta charset=\"utf-8\">authorized_keys\u3092\u4f5c\u6210\u3057\u305f\u5834\u5408\u3001\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u304c\u9069\u6b63\u306a\u3082\u306e\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 600 authorized_keys<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u8a2d\u5b9a\u3092\u884c\u306a\u3063\u305f\u4e0a\u3067\u3001Ansible\u30b5\u30fc\u30d0\u304b\u3089<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306b\u4ee5\u4e0b\u306e\u64cd\u4f5c\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308c\u3070OK\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -i ~\/.ssh\/<meta charset=\"utf-8\">id_rsa \u30d7\u30ed\u30c0\u30af\u30c8\u7ba1\u7406\u30e6\u30fc\u30b6@\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u30a2\u30c9\u30ec\u30b9\uff08IP\u7b49\uff09<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u4f5c\u6210<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u307e\u3067\u3067Ansible\u30b5\u30fc\u30d0\u304b\u3089\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306bSSH\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001Ansible\u306e\u5b9f\u884c\u306b\u969b\u3057\u3066\u540c<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u60c5\u5831\u3092\u8a18\u8ff0\u3057\u305f\u3082\u306e\u304c\u300c\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;group_a]\nxxx.xxx.xxx.001\n<meta charset=\"utf-8\">xxx.xxx.xxx.002\n\n&#91;group_a:vars]\nansible_user=hoge\nansible_ssh_private_key_file=\"~\/.ssh\/id_rsa\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u3067\u306f\u3001\u307e\u305a\u306f<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u8ca0\u8377\u5206\u6563\u74b0\u5883\u3067\u306f\u8907\u6570\u53f0\u306e\u30b5\u30fc\u30d0\u3092\u5bfe\u8c61\u3068\u3059\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u3088\u3063\u3066\u3001\u540c\u3058\u64cd\u4f5c\u306e\u5bfe\u8c61\u3068\u306a\u308b<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3092\u307e\u3068\u3081\u3066\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u3067\u306f\u300cgroup_a\u300d\u3068\u3044\u3046\u30b0\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u3001\u305d\u3053\u306b\u5bfe\u8c61\u3068\u306a\u308b<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u5217\u8a18\u3057\u3066\u3044\u307e\u3059\u3002<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306e\u30a2\u30c9\u30ec\u30b9\u306e\u6307\u5b9a\u65b9\u6cd5\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306bIP\u30a2\u30c9\u30ec\u30b9\u3067\u3082\u826f\u3044\u3067\u3059\u3057\u3001\u30c9\u30e1\u30a4\u30f3\u540d\u3067\u3082\u826f\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u304a\u3001\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u5185\u306b\u8907\u6570\u306e\u30b0\u30eb\u30fc\u30d7\u3092\u5b9a\u7fa9\u53ef\u80fd\u3067\u3042\u308a\u3001\u958b\u767a\u74b0\u5883\u3068\u672c\u756a\u74b0\u5883\u306a\u3069\u5b9f\u884c\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3084\u5b9f\u884c\u3059\u308b\u5185\u5bb9\u304c\u7570\u306a\u308b<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3092\u5225\u306e\u30b0\u30eb\u30fc\u30d7\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u304a\u304f\u3068\u826f\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u3001\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u3067\u306f<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3068\u306e\u901a\u4fe1\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u5909\u6570\u3068\u3057\u3066\u6301\u3064\u3053\u3068\u304c\u3067\u304d\u3001\u7279\u306b\u524d\u8ff0\u306e\u30b0\u30eb\u30fc\u30d7\u5358\u4f4d\u3067\u5909\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u3067\u306f2\u3064\u306e\u5909\u6570\u300c<meta charset=\"utf-8\">ansible_user\u300d\u300c<meta charset=\"utf-8\">ansible_ssh_private_key_file\u300d\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u524d\u8005\u306f<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306bSSH\u63a5\u7d9a\u3059\u308b\u969b\u306e\u30e6\u30fc\u30b6\u540d\u3001\u5f8c\u8005\u306f\u540c\u64cd\u4f5c\u306b\u304a\u3051\u308b\u8a8d\u8a3c\u7528\u306e\u79d8\u5bc6\u9375\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3078\u306e\u30a2\u30af\u30bb\u30b9\u8a2d\u5b9a\u300d\u306e\u6700\u5f8c\u3067\u89e6\u308c\u305f\u3088\u3046\u306b\u3001SSH\u3067<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u30a2\u30c9\u30ec\u30b9\uff08IP\u307e\u305f\u306f\u30c9\u30e1\u30a4\u30f3\uff09\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u304a\u3088\u3073\u8a8d\u8a3c\u7528\u79d8\u5bc6\u9375\u306e3\u3064\u306e\u60c5\u5831\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u3092\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u3067\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u8a33\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3067<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3078\u306e\u63a5\u7d9a\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092Ansible\u304c\u5165\u624b\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Playbook\u4f5c\u6210<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u3044\u3088\u3044\u3088Ansible\u306b\u5177\u4f53\u7684\u306a\u64cd\u4f5c\u5185\u5bb9\u3092\u6307\u793a\u3059\u308b\u305f\u3081\u306e\u300cPlaybook\u300d\u306e\u5185\u5bb9\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<br>\u305f\u3060\u3001\u4eca\u56de\u306fGit\u306b\u3088\u308b\u30c7\u30d7\u30ed\u30a4\u306b\u7279\u5316\u3057\u305f\u5185\u5bb9\u306b\u306a\u308b\u305f\u3081\u3001\u8a18\u8ff0\u5185\u5bb9\u306f\u7c21\u5358\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>---\n- name: \u30c7\u30d7\u30ed\u30a4\n  hosts: group_a\n  tasks:\n    - name: Git\u5b9f\u884c\n      git:\n          repo: https:\/\/\u30e6\u30fc\u30b6\u30fc:\u30d1\u30b9\u30ef\u30fc\u30c9@\u30ea\u30dd\u30b8\u30c8\u30ea\u30a2\u30c9\u30ec\u30b9:\u30dd\u30fc\u30c8\/\u30ea\u30dd\u30b8\u30c8\u30ea\n          dest: \/home\/hoge\/product\n          version: master\n      register: git_result\n\n    - name: \u7d50\u679c\u51fa\u529b\n      debug:\n          msg: \"{{ git_result }}\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u5148\u982d\u884c\u306e\u30cf\u30a4\u30d5\u30f33\u3064\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u5f53\u8a72\u30d5\u30a1\u30a4\u30eb\u304cYAML\u5f62\u5f0f\u3067\u66f8\u304b\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2\u884c\u76ee\u30845\u884c\u76ee\u306f\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u9664\u3044\u305f\u5148\u982d\u306e1\u6587\u5b57\u304c\u30cf\u30a4\u30d5\u30f3\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306fYAML\u5f62\u5f0f\u306b\u304a\u3051\u308b\u30ea\u30b9\u30c8\u7684\u306a\u69cb\u9020\u3092\u793a\u3059\u8a18\u53f7\u3067\u3059\u3002\u3042\u308b\u30a4\u30f3\u30c7\u30f3\u30c8\u306b\u304a\u3051\u308b\u5148\u982d\u304c\u30cf\u30a4\u30d5\u30f3\u306e\u884c\u304b\u3089\u6b21\u306b\u540c\u30a4\u30f3\u30c7\u30f3\u30c8\u306e\u30cf\u30a4\u30d5\u30f3\u3092\u6301\u3064\u884c\u306e\u624b\u524d\u307e\u3067\u30921\u3064\u306e\u307e\u3068\u307e\u3063\u305f\u60c5\u5831\u3068\u307f\u306a\u3057\u3001\u8907\u6570\u306e\u60c5\u5831\u306e\u307e\u3068\u307e\u308a\u3092\u30ea\u30b9\u30c8\u7684\u306b\u8868\u8a18\u3067\u304d\u308b\u8a33\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7279\u306bPlaybook\u306e\u5834\u5408\u306f\u300cplay\u300d\u3068\u300ctask\u300d\u3068\u3044\u30462\u3064\u306e\u60c5\u5831\u3092\u8868\u73fe\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br>\u300cplay\u300d\u306f\u5bfe\u8c61\u3068\u306a\u308b<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3092\u6307\u5b9a\u3057\u3066\u3001\u540c<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306b\u5bfe\u3057\u3066\u3069\u306e\u3088\u3046\u306a\u300ctask\u300d\u3092\u5b9f\u884c\u3059\u308b\u304b\u3068\u3044\u3046\u3053\u3068\u3092\u8a18\u8ff0\u3057\u305f\u3082\u306e\u3067\u3059\u3002<br>\u300ctask\u300d\u306f\u5177\u4f53\u7684\u306b\u5b9f\u65bd\u3059\u308b\u51e6\u7406\u5185\u5bb9\u3092\u8a18\u8ff0\u3057\u305f\u3082\u306e\u3067\u3059\u3002<br>\u4e0a\u8a18\u4f8b\u3067\u306f\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u300cgroup_a\u300d\u306b\u5bfe\u3057\u3066\u30c7\u30d7\u30ed\u30a4\u3092\u884c\u3046play\u304c1\u3064\u5b9a\u7fa9\u3055\u308c\u3066\u304a\u308a\u3001\u540cplay\u3068\u3057\u3066\u671f\u5f85\u3055\u308c\u308b\u51e6\u7406\u3068\u3057\u3066\u306fGit\u306e\u5b9f\u884c\u3068\u305d\u306e\u7d50\u679c\u306e\u51fa\u529b\u3068\u3044\u30462\u3064\u306etask\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cname\u300d\u306f\u5404\u30ea\u30b9\u30c8\u306e\u8981\u7d20\u306b\u5bfe\u3057\u3066\u540c\u8981\u7d20\u306e\u51e6\u7406\u5185\u5bb9\u30fb\u76ee\u7684\u306a\u3069\u3092\u8a18\u8ff0\u3067\u304d\u308b\u3082\u306e\u3067\u3001Playbook\u5185\u3067\u306e\u5404\u8981\u7d20\u306e\u8b58\u5225\u306b\u5f79\u7acb\u3061\u307e\u3059\u3057\u3001\u5b9f\u969b\u306eAnsible\u306e\u5b9f\u884c\u306b\u304a\u3044\u3066\u3082\u540c\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u308b\u305f\u3081\u3001\u3069\u306e\u6bb5\u968e\u307e\u3067\u51e6\u7406\u304c\u9032\u3093\u3067\u3044\u308b\u304b\u304c\u5206\u304b\u308b\u306e\u3067\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300chosts\u300d\u306f\u5f53\u8a72play\u304c\u5bfe\u8c61\u3068\u3059\u308b<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3092\u6307\u5b9a\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300ctasks\u300d\u3067\u306f\u5f53\u8a72play\u3067\u671f\u5f85\u3055\u308c\u308b\u51e6\u7406\u5185\u5bb9\uff08task\uff09\u3092\u8a18\u8ff0\u3057\u3066\u884c\u304d\u307e\u3059\u3002<br>Ansible\u3067\u306f\u5b9f\u884c\u3059\u308b\u51e6\u7406\u3092\u300c\u30e2\u30b8\u30e5\u30fc\u30eb\u300d\u3068\u547c\u3073\u307e\u3059\u304c\u3001\u4e0a\u8a18\u4f8b\u3067\u306f\u300cgit\u300d\u300cregister\u300d\u300cdebug\u300d\u3068\u3044\u30463\u3064\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cgit\u300d\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u6587\u5b57\u901a\u308agit\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u6a5f\u80fd\u3067\u3059\u304c\u3001\u6b63\u78ba\u306b\u306f\u300cgit clone\u300d\u3092\u5b9f\u884c\u3059\u308b\u6a5f\u80fd\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u305f\u3060\u3001\u540c\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u300cupdate\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u3001\u3053\u308c\u304c\u300cyes\u300d\u3067\u3042\u308c\u3070\u300cgit pull\u300d\u3082\u4f75\u305b\u3066\u5b9f\u884c\u3055\u308c\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u300cyes\u300d\u3067\u3059\u3002\u307e\u305f\u3001\u300cgit clone\u300d\u306f1\u3064\u306e<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306b\u5bfe\u3057\u3066\u4e00\u5ea6\u3060\u3051\u5b9f\u884c\u3059\u308c\u3070\u826f\u3044\u64cd\u4f5c\u3067\u3059\u304c\u3001Ansible\u306f\u51aa\u7b49\u6027\u3092\u4fdd\u8a3c\u3057\u3088\u3046\u3068\u3059\u308b\u306e\u3067\u3001\u591a\u91cd\u306b\u5b9f\u884c\u3057\u3066\u3082\u7121\u8996\u3055\u308c\u308b\u3060\u3051\u3067\u3059\u3002<br>\u3064\u307e\u308a\u306f2\u56de\u76ee\u4ee5\u964d\u306e\u5b9f\u884c\u306b\u304a\u3044\u3066\u306f\u5b9f\u8cea\u7684\u306b\u306f\u300cgit pull\u300d\u3092\u884c\u3046\u6a5f\u80fd\u3068\u8003\u3048\u3066\u826f\u304f\u3001\u66f4\u65b0\u5185\u5bb9\u306e\u53cd\u6620\u306b\u7d99\u7d9a\u7684\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">git\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u304c\u3001\u300crepo\u300d\u3067\u306f\u6587\u5b57\u901a\u308a\u5bfe\u8c61\u3068\u306a\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30ea\u30dd\u30b8\u30c8\u30ea\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306fSSH,HTTPS\u3044\u305a\u308c\u306e\u65b9\u6cd5\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u4e0a\u8a18\u4f8b\u3067\u306fHTTPS\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u30ea\u30dd\u30b8\u30c8\u30ea\u3078\u306eURL\u306f\u300chttps:\/\/\u30ea\u30dd\u30b8\u30c8\u30ea\u30a2\u30c9\u30ec\u30b9:\u30dd\u30fc\u30c8\/\u30ea\u30dd\u30b8\u30c8\u30ea\u300d\uff08\u4f8b\uff1ahttps\/\/xxx.xxx.xxx.xxx:8443\/user\/repo.git\uff09\u306e\u3088\u3046\u306a\u5f62\u5f0f\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3055\u3089\u306b\u8a8d\u8a3c\u7528\u306e\u30e6\u30fc\u30b6\u30fc\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u60c5\u5831\u3092\u5408\u308f\u305b\u3066\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br>\u300cdest\u300d\u3067\u306fgit\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u300cversion\u300d\u3067\u306f\u5bfe\u8c61\u3068\u306a\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u6307\u5b9a\u3067\u300cgit clone \uff0b git pull\u300d\u306e\u5b9f\u884c\u306b\u5fc5\u8981\u306a\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3067\u3059\u304c\u3001\u3053\u308c\u3060\u3051\u3060\u3068git\u306e\u5b9f\u884c\u7d50\u679c\u306b\u95a2\u3057\u3066\u306f\u307b\u3068\u3093\u3069\u60c5\u5831\u304c\u5f97\u3089\u308c\u307e\u305b\u3093\u3002<br>\u3088\u3063\u3066\u3001\u3068\u308a\u3042\u3048\u305a\u300cregister\u300d\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u5b9f\u884c\u7d50\u679c\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u304a\u3044\u3066\u3001\u300cdebug\u300d\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u305d\u306e\u5185\u5bb9\u3092\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002<br>\u305f\u3060\u3001\u3053\u308c\u3067\u3082\u5f97\u3089\u308c\u308b\u60c5\u5831\u306f\u4e0b\u8a18\u7a0b\u5ea6\u3067\u3059\u304c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ok: &#91;<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u30a2\u30c9\u30ec\u30b9] => {\n    \"msg\": {\n        \"after\": \"9125cf6d08466c985f6fff6427e63315253db2d7\",\n        \"before\": \"2a0aacaf2e232a416f43bba3f004298a3ea14698\",\n        \"changed\": true,\n        \"failed\": false,\n        \"remote_url_changed\": false\n    }\n}<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Playbook\u5b9f\u884c<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u3067Ansible\u306b\u3088\u308bGit\u5b9f\u884c\u306e\u6e96\u5099\u306f\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3067\u306f\u5b9f\u969b\u306bPlaybook\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<br>\u30a4\u30f3\u30d9\u30f3\u30c8\u30ea\u306f\u300cinventory\u300d\u3001Playbook\u306f\u300cplaybook.yml\u300d\u3068\u3044\u3046\u540d\u79f0\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u305f\u5834\u5408\u3001Playbook\u306e\u5b9f\u884c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ansible-playbook -i inventory playbook.yml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u884c\u306e\u6700\u5f8c\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u884c\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PLAY RECAP *********************************************************************\n<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u30a2\u30c9\u30ec\u30b9  : ok=6    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3068\u308a\u3042\u3048\u305a\u300cunreachable\u300d\uff08\u5bfe\u8c61<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304b\u3063\u305f\u30bf\u30b9\u30af\u6570\uff09\u300cfailed\u300d\uff08<meta charset=\"utf-8\">\u5bfe\u8c61<meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u30bf\u30b9\u30af\u6570\uff09\u304c0\u3067\u3042\u308c\u3070Playbook\u306e\u5b9f\u884c\u3068\u3057\u3066\u306f\u6210\u529f\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305f\u3060\u3057\u3001\u3042\u304f\u307e\u3067Playbook\u306e\u5404\u30bf\u30b9\u30af\u304c\u554f\u984c\u306a\u304f\u5b9f\u884c\u3067\u304d\u305f\u3068\u8a00\u3046\u3060\u3051\u3067\u3001\u671f\u5f85\u3055\u308c\u3066\u3044\u308b\u51e6\u7406\u304c\u6b63\u3057\u304f\u884c\u308f\u308c\u305f\u3053\u3068\u3092\u4fdd\u8a3c\u3059\u308b\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070Playbook\u306e\u8a18\u8ff0\u81ea\u4f53\u306b\u6f0f\u308c\u3084\u9593\u9055\u3044\u304c\u3042\u3063\u3066\u3001\u30bf\u30b9\u30af\u306e\u5b9f\u884c\u3068\u3057\u3066\u306f\u554f\u984c\u306a\u304f\u3066\u3082\u3001\u671f\u5f85\u3057\u305f\u7d50\u679c\u304c\u5f97\u3089\u308c\u3066\u3044\u306a\u3044\u3068\u8a00\u3046\u3053\u3068\u306f\u5f80\u3005\u306b\u3057\u3066\u6709\u308a\u307e\u3059\u3002<br>Playbook\u306e\u4f5c\u6210\u3084\u66f4\u65b0\u5f8c\u306f\u3001\u5b9f\u969b\u306b\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u4e0a\u3067\u671f\u5f85\u3057\u305f\u7d50\u679c\u304c\u5f97\u3089\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u7dcf\u62ec<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u3068\u308a\u3042\u3048\u305aGit\u3092\u7528\u3044\u305f\u30c7\u30d7\u30ed\u30a4\u3068\u3044\u3046\u9650\u5b9a\u7684\u30c6\u30fc\u30de\u3067Ansible\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5358\u306b\u300cgit clone\u300d\u300cgit pull\u300d\u3092\u884c\u3046\u3060\u3051\u3067\u3042\u308c\u3070\u5c02\u7528\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u7c21\u5358\u306b\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002\u7279\u306bclone\u3068pull\u3092\u533a\u5225\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u70b9\u306f\u697d\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u3088\u3046\u306b\u76ee\u7684\u306b\u30c9\u30f3\u30d4\u30b7\u30e3\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u306a\u3044\u5834\u5408\u3067\u3082\u3001\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u3067\u5b9f\u884c\u53ef\u80fd\u306a\u30b3\u30de\u30f3\u30c9\u3067\u3042\u308c\u3070\u300ccommand\u300d\u3084\u300cshell\u300d\u3068\u8a00\u3046\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3055\u3089\u306b\u305d\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u306b\u304a\u3044\u3066\u5165\u529b\u3092\u6c42\u3081\u3089\u308c\u308b\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3082\u3042\u308b\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u60f3\u5b9a\u3055\u308c\u308b\u5165\u529b\u3082\u542b\u3081\u3066\u5b9a\u7fa9\u3067\u304d\u308b\u300cexpect\u300d\u3068\u3044\u3046\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u3042\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br><meta charset=\"utf-8\">\u88ab\u7ba1\u7406\u30b5\u30fc\u30d0\u306bSSH\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u5b9f\u884c\u3067\u304d\u308b\u51e6\u7406\u3067\u3042\u308c\u3070\u3001\u5927\u534a\u306fAnsible\u304b\u3089\u5b9f\u884c\u53ef\u80fd\u3068\u8003\u3048\u3066\u826f\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\uff08\u78ba\u8a3c\u306f\u3042\u308a\u307e\u305b\u3093\u304c\uff09\u3002\u305f\u3060\u51aa\u7b49\u6027\u304c\u78ba\u4fdd\u3067\u304d\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306f\u6ce8\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u304a\u3001Ansible\u306e\u672c\u6765\u306e\u76ee\u7684\u306f\u30b5\u30fc\u30d0\u74b0\u5883\u69cb\u7bc9\u5168\u822c\u306b\u95a2\u308f\u308bIaC\u5316\u3067\u3042\u308a\u3001\u305d\u306e\u3088\u3046\u306a\u76ee\u7684\u3092\u9054\u6210\u3059\u308b\u305f\u3081\u306ePlaybook\u3092\u66f8\u3053\u3046\u3068\u601d\u3046\u3068\u8a18\u8ff0\u91cf\u3082\u683c\u6bb5\u306b\u591a\u304f\u306a\u308a\u307e\u3059\u3002\u305d\u3046\u306a\u308b\u30681\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5168\u3066\u3092\u8a18\u8ff0\u3059\u308b\u306e\u306f\u7169\u96d1\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u306e\u3067\u30d5\u30a1\u30a4\u30eb\u5206\u5272\u3084\u5171\u6709\u3082\u3057\u305f\u304f\u306a\u3063\u3066\u304d\u307e\u3059\u3002<br>\u5f53\u7136\u306a\u304c\u3089Ansible\u306b\u306fPlaybook\u306e\u5185\u5bb9\u3092\u5206\u5272\u3057\u305f\u308a\u5171\u6709\u3057\u305f\u308a\u3059\u308b\u4ed5\u7d44\u307f\u3082\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u8fba\u306b\u3064\u3044\u3066\u306f\u307e\u305f\u5225\u306e\u6a5f\u4f1a\u306b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ansible\u306fIaC\uff08Infrastructure as Code\uff09\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3067\u3001\u3042\u3089\u304b\u3058\u3081Playbook\u3068\u547c\u3070\u308c\u308b\u30d5\u30a1\u30a4\u30eb\u306b\u5b9a\u7fa9\u3057\u305f\u5185\u5bb9\u306b\u5f93\u3063\u3066\u30b5\u30fc\u30d0\u74b0\u5883\u306e\u69cb\u7bc9\uff08\u30bd\u30d5\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084\u8a2d\u5b9a\u306a\u3069\uff09\u3092\u30d0\u30c3\u30c1\u7684\u306b\u5b9f\u884c\u3057 [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":3397,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[210],"tags":[],"class_list":["post-3396","post","type-post","status-publish","format-standard","has-post-thumbnail","category-210"],"_links":{"self":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/3396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/comments?post=3396"}],"version-history":[{"count":0,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/3396\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media\/3397"}],"wp:attachment":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media?parent=3396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/categories?post=3396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/tags?post=3396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}