{"id":248,"date":"2017-11-28T08:00:16","date_gmt":"2017-11-27T23:00:16","guid":{"rendered":"http:\/\/www.itc109.com\/knowledge\/?p=248"},"modified":"2021-09-30T09:00:03","modified_gmt":"2021-09-30T00:00:03","slug":"ansible-mysql-remote-install","status":"publish","type":"post","link":"https:\/\/www.itc109.com\/knowledge\/linux\/ansible-mysql-remote-install","title":{"rendered":"Ansible \u2013 MySQL \u30ea\u30e2\u30fc\u30c8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<h4><strong>\u6982\u8981<\/strong><\/h4>\n<hr \/>\n<p>Ansible\u3092\u4f7f\u7528\u3057\u3066\u4ed6\u306e\u30b5\u30fc\u30d0\u30fc\u306bmysql\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4><strong>\u624b\u9806<\/strong><\/h4>\n<hr \/>\n<p><strong>1.\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong><\/p>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u8f2a\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">ansible TARGET_HOSTS -m yum -a \"name=http:\/\/dev.mysql.com\/get\/mysql57-community-release-el7-11.noarch.rpm\" -u centos --sudo<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<pre>xxx.xxx.xxx.xxx | SUCCESS =&gt; {\r\n    \"changed\": true,\r\n    \"msg\": \"\",\r\n    \"rc\": 0,\r\n    \"results\": [        \"Loaded plugins: fastestmirror\\n\r\nExamining \/tmp\/tmp7t8oxW\/mysql57-community-release-el7-11.noarch.rpm: mysql57-community-release-el7-11.noarch\\n\r\nMarking \/tmp\/tmp7t8oxW\/mysql57-community-release-el7-11.noarch.rpm to be installed\\n\r\nResolving Dependencies\\n\r\n--&gt; Running transaction check\\n\r\n---&gt; Package mysql57-community-release.noarch 0:el7-11 will be installed\\n\r\n--&gt; Finished Dependency Resolution\\n\r\n\\n\r\nDependencies Resolved\\n\r\n\\n\r\n================================================================================\\n\r\n Package           Arch   Version\\n\r\n                                 Repository                                Size\\n\r\n================================================================================\\n\r\nInstalling:\\n mysql57-community-release\\n\r\n                   noarch el7-11 \/mysql57-community-release-el7-11.noarch  31 k\\n\r\n\\n\r\nTransaction Summary\\n\r\n================================================================================\\n\r\nInstall  1 Package\\n\r\n\\n\r\nTotal size: 31 k\\n\r\nInstalled size: 31 k\\n\r\nDownloading packages:\\n\r\nRunning transaction check\\n\r\nRunning transaction test\\n\r\nTransaction test succeeded\\n\r\nRunning transaction\\n\r\n  Installing : mysql57-community-release-el7-11.noarch                      1\/1 \\n\r\n  Verifying  : mysql57-community-release-el7-11.noarch                      1\/1 \\n\r\n\\n\r\nInstalled:\\n\r\n  mysql57-community-release.noarch 0:el7-11                                     \\n\r\n\\n\r\nComplete!\\n\"\r\n    ]\r\n}\r\n<\/pre>\n<p>\u300cComplete!\u300d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><\/p>\n<pre>ansible TARGET_HOSTS -a \"sudo yum -y install mysql\"\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<pre>xxx.xxx.xxx.xxx | SUCCESS | rc=0 &gt;&gt;\r\nLoaded plugins: fastestmirror\r\nDetermining fastest mirrors\r\n * base: ftp.riken.jp\r\n * extras: ftp.riken.jp\r\n * updates: ftp.riken.jp\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package mysql-community-client.x86_64 0:5.7.19-1.el7 will be installed\r\n--&gt; Processing Dependency: mysql-community-libs(x86-64) &gt;= 5.7.9 for package: mysql-community-client-5.7.19-1.el7.x86_64\r\n--&gt; Running transaction check\r\n---&gt; Package mariadb-libs.x86_64 1:5.5.52-1.el7 will be obsoleted\r\n--&gt; Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64\r\n--&gt; Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64\r\n---&gt; Package mysql-community-libs.x86_64 0:5.7.19-1.el7 will be obsoleting\r\n--&gt; Processing Dependency: mysql-community-common(x86-64) &gt;= 5.7.9 for package: mysql-community-libs-5.7.19-1.el7.x86_64\r\n--&gt; Running transaction check\r\n---&gt; Package mysql-community-common.x86_64 0:5.7.19-1.el7 will be installed\r\n---&gt; Package mysql-community-libs-compat.x86_64 0:5.7.19-1.el7 will be obsoleting\r\n--&gt; Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n================================================================================\r\n Package                      Arch    Version          Repository          Size\r\n================================================================================\r\nInstalling:\r\n mysql-community-client       x86_64  5.7.19-1.el7     mysql57-community   24 M\r\n mysql-community-libs         x86_64  5.7.19-1.el7     mysql57-community  2.1 M\r\n     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7\r\n mysql-community-libs-compat  x86_64  5.7.19-1.el7     mysql57-community  2.0 M\r\n     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7\r\nInstalling for dependencies:\r\n mysql-community-common       x86_64  5.7.19-1.el7     mysql57-community  272 k\r\n\r\nTransaction Summary\r\n================================================================================\r\nInstall  3 Packages (+1 Dependent package)\r\n\r\nTotal download size: 28 M\r\nDownloading packages:\r\nPublic key for mysql-community-common-5.7.19-1.el7.x86_64.rpm is not installed\r\n--------------------------------------------------------------------------------\r\nTotal                                               23 MB\/s |  28 MB  00:01\r\nRetrieving key from file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql\r\nRunning transaction check\r\nRunning transaction test\r\nTransaction test succeeded\r\nRunning transaction\r\n  Installing : mysql-community-common-5.7.19-1.el7.x86_64                   1\/5\r\n  Installing : mysql-community-libs-5.7.19-1.el7.x86_64                     2\/5\r\n  Installing : mysql-community-libs-compat-5.7.19-1.el7.x86_64              3\/5\r\n  Installing : mysql-community-client-5.7.19-1.el7.x86_64                   4\/5\r\n  Erasing    : 1:mariadb-libs-5.5.52-1.el7.x86_64                           5\/5\r\n  Verifying  : mysql-community-libs-5.7.19-1.el7.x86_64                     1\/5\r\n  Verifying  : mysql-community-common-5.7.19-1.el7.x86_64                   2\/5\r\n  Verifying  : mysql-community-libs-compat-5.7.19-1.el7.x86_64              3\/5\r\n  Verifying  : mysql-community-client-5.7.19-1.el7.x86_64                   4\/5\r\n  Verifying  : 1:mariadb-libs-5.5.52-1.el7.x86_64                           5\/5\r\n\r\nInstalled:\r\n  mysql-community-client.x86_64 0:5.7.19-1.el7\r\n  mysql-community-libs.x86_64 0:5.7.19-1.el7\r\n  mysql-community-libs-compat.x86_64 0:5.7.19-1.el7\r\n\r\nDependency Installed:\r\n  mysql-community-common.x86_64 0:5.7.19-1.el7\r\n\r\nReplaced:\r\n  mariadb-libs.x86_64 1:5.5.52-1.el7\r\n\r\nComplete!\r\nwarning: \/var\/cache\/yum\/x86_64\/7\/mysql57-community\/packages\/mysql-community-common-5.7.19-1.el7.x86_64.rpm: Header V3 DSA\/SHA1 Signature, key ID 5072e1f5: NOKEY\r\nImporting GPG key 0x5072E1F5:\r\n Userid     : \"MySQL Release Engineering &lt;mysql-build@oss.oracle.com&gt;\"\r\n Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5\r\n Package    : mysql57-community-release-el7-11.noarch (installed)\r\n From       : \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>3.\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u78ba\u8a8d<\/strong><br \/>\n \u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre>ansible TARGET_HOSTS -a \"mysql --version\"\r\n<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<pre>xxx.xxx.xxx.xxx | SUCCESS | rc=0 &gt;&gt;\r\nmysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 Ansible\u3092\u4f7f\u7528\u3057\u3066\u4ed6\u306e\u30b5\u30fc\u30d0\u30fc\u306bmysql\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u624b\u9806\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002 \u624b\u9806 1.\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 \u6b21\u306e\u30b3\u30de\u30f3\u30c9\u8f2a\u5b9f\u884c\u3057\u307e\u3059\u3002 ansible TARGET_HOSTS -m yum&#8230;<\/p>\n","protected":false},"author":3,"featured_media":177,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[23,3],"tags":[60],"class_list":["post-248","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-linux","tag-ansible"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.itc109.com\/knowledge\/wp-content\/uploads\/sites\/2\/logo-ansible.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pacZwp-40","_links":{"self":[{"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/posts\/248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/comments?post=248"}],"version-history":[{"count":9,"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/posts\/248\/revisions"}],"predecessor-version":[{"id":1787,"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/posts\/248\/revisions\/1787"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/media\/177"}],"wp:attachment":[{"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/media?parent=248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/categories?post=248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itc109.com\/knowledge\/wp-json\/wp\/v2\/tags?post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}