{"id":42530,"date":"2023-03-25T21:15:56","date_gmt":"2023-01-15T21:50:02","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/"},"modified":"2024-04-29T20:30:20","modified_gmt":"2024-04-29T12:30:20","slug":"%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/","title":{"rendered":"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c"},"content":{"rendered":"<h1>\u6982\u8ff0<\/h1>\n<p>\u7531\u4e8e\u5185\u5bb9\u8f83\u957f\uff0c\u6700\u597d\u67e5\u9605\u76ee\u5f55\u3002<\/p>\n<h2>\u76ee\u6807<\/h2>\n<p>\u5728\u5927\u91cf\u8bbe\u7f6e\u8282\u70b9\u65f6\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\u80fd\u8ba9\u8fd9\u4e2a\u8fc7\u7a0b\u53d8\u5f97\u66f4\u8f7b\u677e\u4e00\u70b9\u5462\uff1f<br \/>\n\u6bd4\u5982\uff0c\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4ee5\u901a\u8fc7PXE\u8fdb\u884c\u5b89\u88c5\uff0c\u800c\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u88c5\u53ef\u4ee5\u901a\u8fc7\u67d0\u4e2a\u670d\u52a1\u5668\u4f7f\u7528ansible\u7b49\u5de5\u5177\u6765\u6267\u884c\u3002<br \/>\n\u8fd9\u6837\u64cd\u4f5c\u4eba\u5458\u5c31\u53ef\u4ee5\u53c2\u4e0e\u5176\u4e2d\u4e86\u3002\uff08\u73b0\u5728\u53ef\u80fd\u901a\u8fc7k8s\u7b49\u81ea\u52a8\u5316\u5b8c\u6210\u4e86\u5427\uff09<\/p>\n<p>\u6211\u4e0d\u77e5\u9053\u8fd9\u662f\u5426\u662f\u5e38\u6001\uff0c\u4f46\u662f\u8282\u70b9\u90e8\u7f72\u7684\u6570\u91cf\u8d8a\u591a\uff0c\u64cd\u4f5c\u7cfb\u7edf\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u88c5\u5c31\u4f1a\u4ea4\u53c9\u8fdb\u884c\u3002<\/p>\n<p>\u4e5f\u8bb8\u6211\u4ecd\u5728\u505a\u4e00\u4e9b\u8fc7\u65f6\u7684\u4e8b\u60c5\uff0c\u4f46\u6211\u5e76\u4e0d\u786e\u5b9a\u8fd9\u79cd\u60c5\u51b5\u3002<\/p>\n<p>\u662f\u5426\u6709\u53ef\u80fd\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u5b8c\u6210\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u88c5\uff1f<\/p>\n<p>\u6211\u8bd5\u7740\u4ee5\u201c\u5173\u4e8e\u8fd9\u4e2a\u8bdd\u9898\u8fdb\u884c\u601d\u8003\u201d\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u6211\u8fd8\u662f\u89c9\u5f97\u8fd9\u53ea\u662f\u4e2a\u8868\u9762\u73b0\u8c61\uff0c\u6211\u6700\u60f3\u4e86\u89e3\u7684\u8fd8\u662f\u6700\u8fd1\u7684\u8d8b\u52bf\u3002<br \/>\n\u6211\u8ba4\u4e3a\u73b0\u5728\u5df2\u7ecf\u6ca1\u6709\u4eba\u4ecb\u5165\u7684\u65f6\u4ee3\u4e86\uff0c\u4ece\u64cd\u4f5c\u7cfb\u7edf\u7684\u8bbe\u7f6e\u5230\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u88c5\u7b49\u7b49\u3002<\/p>\n<p>\u5927\u5bb6\u90fd\u662f\u600e\u4e48\u505a\u7684\u5462\uff08==\uff1b<\/p>\n<h2>\u65b9\u6cd5<\/h2>\n<p>\u5728\u901a\u8fc7PXE\u8fdb\u884c\u64cd\u4f5c\u7cfb\u7edf\u5b89\u88c5\u65f6\uff0c\u9700\u8981\u5728\u76ee\u6807\u8282\u70b9\u4e0a\u6784\u5efaansible\u6267\u884c\u73af\u5883\u3002<br \/>\n\u5728systemd\u4e0a\u6dfb\u52a0\u81ea\u52a8\u90e8\u7f72\u673a\u5236\uff08\u4ec5\u4ec5\u662f\u89e6\u53d1ansible\u7684\u670d\u52a1\uff09\uff0c\u5e76\u5c06\u8be5\u670d\u52a1\u8bbe\u7f6e\u4e3a\u81ea\u52a8\u542f\u52a8\u3002<\/p>\n<p>\u8fd9\u6b21\u6211\u8003\u8651\u4e86\u4e00\u4e0b\u8fd9\u4e2a\u90e8\u5206\u7684\u51c6\u5907\u5de5\u4f5c\u3002<\/p>\n<h2>\u9009\u62e9\u4f7f\u7528systemd\u7684\u539f\u56e0<\/h2>\n<p>\u4ee5\u4e0b\u662f\u91c7\u7528systemd\u7684\u539f\u56e0\uff1a\u53ef\u4ee5\u5728\u542f\u52a8\u65f6\u4f7f\u7528\u5404\u79cd\u5de5\u5177\u6784\u5efa\u811a\u672c\uff0c\u5982rc.local\u7b49\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u51fa\u6765\u308b\u3060\u3051\u30b9\u30af\u30ea\u30d7\u30c8\u7cfb\u306f\u4f7f\u3044\u305f\u304f\u7121\u3044\u3002\uff08\u6c4e\u7528\u6027\u306f\u5f97\u308b\u304c\u7ba1\u7406\u304c\u9762\u5012\uff09<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">ansible\u306fssh.service\u7b49\u306e\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\u5f8c\u306b\u5b9f\u65bd\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u6545\u306b\u30b5\u30fc\u30d3\u30b9\u5b9f\u884c\u9806\u5e8f\u3092\u5236\u5fa1\u3057\u305f\u3044<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u6210\u529f\u8981\u5426\u3092\u5bb9\u6613\u304f\u898b\u308c\u308b\u3088\u3046\u306b\u3057\u305f\u3044(systemd status\u3067\u7d50\u69cb\u308f\u304b\u308a\u3084\u3059\u304f\u898b\u308c\u305f\uff09<\/ul>\n<h2>\u786e\u8ba4\u73af\u5883<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">conoha VPS(break &amp; build\u3067\u91cd\u5b9d\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u3066\u307e\u3059\uff08\uff1aDTZ<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">OS : ubuntu16.04.5<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">ansible : 2.7.7(using pip)<\/ul>\n<hr \/>\n<h1>\u7ed3\u679c<\/h1>\n<p>\u5b8c\u6210\u4ee5\u4e0a\u4e24\u4e2a\u6587\u4ef6\u540e\uff0c\u53ef\u4ee5\u6267\u884cansible\u3002<br \/>\n\u5728\u672c\u8282\u4e2d\uff0c\u5c06\u63cf\u8ff0\u8981\u70b9\u3002<\/p>\n<pre class=\"post-pre\"><code>root@118-27-10-158:~\/auto-deploy_ansible\/ansible# <span class=\"nb\">cat<\/span> \/etc\/systemd\/system\/auto-deploy.service\r\n<span class=\"o\">[<\/span>Unit]\r\nDescription <span class=\"o\">=<\/span> Auto Deploy using Ansible.\r\nAfter <span class=\"o\">=<\/span> ssh.service apt-daily-upgrade.timer apt-daily.timer\r\n\r\n<span class=\"o\">[<\/span>Service]\r\nEnvironmentFile <span class=\"o\">=<\/span> \/etc\/default\/auto-deploy\r\nExecStart <span class=\"o\">=<\/span> \/usr\/local\/bin\/ansible-playbook <span class=\"nt\">-i<\/span> inventories\/staging\/hosts <span class=\"k\">${<\/span><span class=\"nv\">PLAYBOOK<\/span><span class=\"k\">}<\/span> <span class=\"nt\">-t<\/span> <span class=\"k\">${<\/span><span class=\"nv\">TAG<\/span><span class=\"k\">}<\/span> <span class=\"nt\">-l<\/span> <span class=\"k\">${<\/span><span class=\"nv\">HOSTNAME<\/span><span class=\"k\">}<\/span>\r\nWorkingDirectory <span class=\"o\">=<\/span> \/root\/auto-deploy_ansible\/ansible\/\r\nType <span class=\"o\">=<\/span> oneshot\r\n\r\n<span class=\"o\">[<\/span>Install]\r\nWantedBy <span class=\"o\">=<\/span> multi-user.target\r\nroot@118-27-10-158:~\/auto-deploy_ansible\/ansible#\r\n\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>root@118-27-10-158:~\/auto-deploy_ansible\/ansible# cat \/etc\/default\/auto-deploy\r\nTAG=\"auto-deploy\"\r\nPLAYBOOK=\"auto-deploy.yml\"\r\nHOSTNAME=\"118-27-10-158\"\r\nroot@118-27-10-158:~\/auto-deploy_ansible\/ansible#\r\n<\/code><\/pre>\n<h2>\u6587\u4ef6\u5355\u4f4d\u7684\u91cd\u70b9<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5909\u6570\u5316\u3057\u305f\u65b9\u304c\u6271\u3044\u6613\u3044\u306e\u3067EnvironmentFile\u306b\u5909\u6570\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>ExecStart\u306fansible\u306e\u30d5\u30eb\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\u3002\uff08\u30d1\u30b9\u304c\u901a\u3063\u3066\u3066\u3082NG\uff09<\/p>\n<p>WorkingDirectory\u306bansible\u306e\u5b9f\u884c\u30d1\u30b9\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<p>ansible.cfg\u306fWorkingDirectory\u914d\u4e0b\u3082\u3057\u304f\u306f\u300c\/etc\/ansible\u300d\u7b49\u5b9f\u884c\u6642\u306b\u53c2\u7167\u51fa\u6765\u308b\u72b6\u6cc1\u306b\u3059\u308b<\/p>\n<p>After\u306e\u7bc0\u306fssh.service\u8d77\u52d5\u5f8c\u304c\u524d\u63d0\u6761\u4ef6<\/p>\n<p>apt-daily-upgrade.time\u306e\u8a18\u8ff0\u7406\u7531\u306f\u5f53\u8a72\u30b5\u30fc\u30d3\u30b9\u304cEnable\u306e\u5834\u5408\u3001apt\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u7af6\u5408\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u304b\u3089\u5f85\u3064\u3002<\/p>\n<p>Type\u3092oneshot\u306b\u3057\u3066\u3044\u308b\u306e\u306f1\u56de\u306e\u307f\u5b9f\u884c\u306b\u660e\u793a\u7684\u306b\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u3002(\u6210\u5426\u554f\u308f\u305a1\u56de\u306e\u307f\u3060\uff09<\/p>\n<h2>\u670d\u52a1\u6267\u884c\u65f6\u7684\u65e5\u5fd7\uff0c\u6210\u529f\u65f6\u3002<\/h2>\n<p>\u670d\u52a1\u8fd0\u884c\u65f6\u4f1a\u6267\u884cansible\u3002<br \/>\n\u6267\u884c\u540e\uff0c\u72b6\u6001\u5c06\u53d8\u4e3ainactive(loaded)\u3002<br \/>\n\u6839\u636e\u6700\u65b0\u7684\u65e5\u5fd7\u8f93\u51fa\u53ef\u4ee5\u5224\u65ad\u51faansible\u7684\u6267\u884c\u65e5\u5fd7\u3002<\/p>\n<pre class=\"post-pre\"><code>root@118-27-10-158:~# systemctl start auto-deploy.service\r\nroot@118-27-10-158:~# systemctl status auto-deploy.service\r\n\u25cf auto-deploy.service - Auto Deploy using Ansible.\r\n   Loaded: loaded (\/etc\/systemd\/system\/auto-deploy.service; disabled; vendor preset: enabled)\r\n   Active: inactive (dead)\r\n\r\nFeb 11 15:19:40 118-27-10-158 ansible-playbook[6990]: ok: [118-27-10-158]\r\nFeb 11 15:19:40 118-27-10-158 ansible-playbook[6990]: TASK [systemd : disable auto-deploy service] ***********************************\r\nFeb 11 15:19:41 118-27-10-158 ansible-playbook[6990]: ok: [118-27-10-158]\r\nFeb 11 15:19:41 118-27-10-158 ansible-playbook[6990]: TASK [apt : Only run \"update_cache=yes\"(apt-get update)] ***********************\r\nFeb 11 15:19:43 118-27-10-158 ansible-playbook[6990]: changed: [118-27-10-158]\r\nFeb 11 15:19:43 118-27-10-158 ansible-playbook[6990]: TASK [libvirt : Install libvirt-bin] *******************************************\r\nFeb 11 15:19:44 118-27-10-158 ansible-playbook[6990]: ok: [118-27-10-158]\r\nFeb 11 15:19:44 118-27-10-158 ansible-playbook[6990]: PLAY RECAP *********************************************************************\r\nFeb 11 15:19:44 118-27-10-158 ansible-playbook[6990]: 118-27-10-158              : ok=6    changed=1    unreachable=0    failed=0\r\nFeb 11 15:19:44 118-27-10-158 systemd[1]: Started Auto Deploy using Ansible..\r\nroot@118-27-10-158:~#\r\n<\/code><\/pre>\n<h2>\u5728\u670d\u52a1\u6267\u884c\u65f6\u7684\u65e5\u5fd7\uff0c\u5f53\u51fa\u73b0\u5931\u8d25\u65f6<\/h2>\n<p>\u5bfc\u5165\u4e0e\u6210\u529f\u65f6\u76f8\u540c\u3002<br \/>\n\u6267\u884c\u540e\u5c06\u4e3a\u201c\u6d3b\u52a8\uff1a\u5931\u8d25\u201d\uff0c\u53ea\u9700\u5728\u6b64\u5904\u67e5\u770b\u5373\u53ef\u5224\u65ad\u7ed3\u679c\u3002<\/p>\n<pre class=\"post-pre\"><code>root@118-27-10-158:~\/auto-deploy_ansible\/ansible# systemctl start auto-deploy.service\r\nJob for auto-deploy.service failed because the control process exited with error code. See \"systemctl status auto-deploy.service\" and \"journalctl -xe\" for details.\r\nroot@118-27-10-158:~\/auto-deploy_ansible\/ansible# systemctl status auto-deploy.service\r\n\u25cf auto-deploy.service - Auto Deploy using Ansible.\r\n   Loaded: loaded (\/etc\/systemd\/system\/auto-deploy.service; disabled; vendor preset: enabled)\r\n   Active: failed (Result: exit-code) since Mon 2019-02-11 15:24:11 JST; 8s ago\r\n  Process: 7742 ExecStart=\/usr\/local\/bin\/ansible-playbook -i inventories\/staging\/hosts ${PLAYBOOK} -t ${TAG} -l ${HOSTNAME} (code=exited, status=4)\r\n Main PID: 7742 (code=exited, status=4)\r\n\r\nFeb 11 15:24:10 118-27-10-158 systemd[1]: Starting Auto Deploy using Ansible....\r\nFeb 11 15:24:11 118-27-10-158 ansible-playbook[7742]: ERROR! Syntax Error while loading YAML.\r\nFeb 11 15:24:11 118-27-10-158 ansible-playbook[7742]:   found unexpected end of stream\r\nFeb 11 15:24:11 118-27-10-158 ansible-playbook[7742]: The error appears to have been in '\/root\/auto-deploy_ansible\/ansible\/roles\/common\/tasks\/debug\/debug_mes.yml': line 4, column 1,\r\nFeb 11 15:24:11 118-27-10-158 ansible-playbook[7742]: be elsewhere in the file depending on the exact syntax problem.\r\nFeb 11 15:24:11 118-27-10-158 ansible-playbook[7742]: (specified line no longer in file, maybe it changed?)\r\nFeb 11 15:24:11 118-27-10-158 systemd[1]: auto-deploy.service: Main process exited, code=exited, status=4\/NOPERMISSION\r\nFeb 11 15:24:11 118-27-10-158 systemd[1]: Failed to start Auto Deploy using Ansible..\r\nFeb 11 15:24:11 118-27-10-158 systemd[1]: auto-deploy.service: Unit entered failed state.\r\nFeb 11 15:24:11 118-27-10-158 systemd[1]: auto-deploy.service: Failed with result 'exit-code'.\r\nroot@118-27-10-158:~\/auto-deploy_ansible\/ansible#\r\n<\/code><\/pre>\n<h2>ansible\u65e5\u5fd7\u7ba1\u7406<\/h2>\n<p>\u8fd9\u4e0d\u662f\u672c\u9875\u9762\u7684\u76ee\u7684\u3002\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728ansible.cfg\u4e2d\u5b9a\u4e49\u65e5\u5fd7\u8f93\u51fa\u8def\u5f84\u6765\u786e\u4fdd\u65e5\u5fd7\u4e0e\u5e38\u89c4\u7684ansible\u6267\u884c\u4e00\u6837\u3002<\/p>\n<hr \/>\n<h1>\u4eb2\u81ea\u52a8\u624b<\/h1>\n<p>\u56e0\u4e3a\u91cd\u590d\u5b9e\u9a8c\u592a\u9ebb\u70e6\u4e86\uff0c\u6240\u4ee5\u6211\u5236\u4f5c\u4e86\u6837\u672c\u7d20\u6750\uff0c\u53ef\u4ee5\u5171\u4eab\u7ed9\u5927\u5bb6\u3002\u4f7f\u7528ansible\u81ea\u52a8\u90e8\u7f72\u3002<\/p>\n<p>\u9019\u500b\u57f7\u884c\u6b65\u9a5f\u662f\u5728\u4f7f\u7528\u4e0a\u8ff0\u8cc7\u6750\u7684\u524d\u63d0\u4e0b\u9032\u884c\u63cf\u8ff0\u3002<\/p>\n<h2>\u51c6\u5907ansible\u81ea\u52a8\u6267\u884c\u73af\u5883\u3002<\/h2>\n<p>\u76ee\u524d\u6b63\u5728\u505a\u7684\u4e8b\u60c5\u662f\u5b89\u88c5Ansible\u5305\u5e76\u914d\u7f6esystemd\u76f8\u5173\u6587\u4ef6\u3002\u63a5\u4e0b\u6765\u662f\u5bf9\u81ea\u8eab\u8fdb\u884cSSH\u65e0\u5bc6\u7801\u8bbe\u7f6e\u548c\u786e\u8ba4\u3002\u6700\u540e\uff0c\u5728Ansible\u7684\u6e05\u5355\u4e2d\u6dfb\u52a0\u4e3b\u673a\u540d\u5c31\u5b8c\u6210\u4e86\u51c6\u5907\u5de5\u4f5c\u3002\u8d44\u6599\u5185\u5bb9\u5e76\u4e0d\u590d\u6742\uff0c\u5982\u679c\u67e5\u770bgithub\u5c31\u53ef\u4ee5\u7406\u89e3\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">git clone https:\/\/github.com\/maki0922\/auto-deploy_ansible<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">cd auto-deploy_ansible\/prepare\/<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">bash -x setting_systemd.yml<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">bash -x prepare_pip.sh<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">bash -x install_package.sh<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">ssh-keygen -t rsa -b 4096 -C &#8220;your_email@example.com&#8221;<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">ssh-copy-id<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">ssh<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">exit<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">edit ..\/ansible\/inventories\/staging\/hosts (add hostname to computer block)<\/ul>\n<h3>\u670d\u52a1\u72b6\u6001<\/h3>\n<p>\u53ea\u8981\u81ea\u52a8\u542f\u52a8\u8bbe\u7f6e\u5df2\u7ecf\u542f\u7528\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code>root@118-27-24-70:~\/auto-deploy_ansible\/prepare# systemctl status auto-deploy.service\r\n\u25cf auto-deploy.service - Auto Deploy using Ansible.\r\n   Loaded: loaded (\/etc\/systemd\/system\/auto-deploy.service; enabled; vendor preset: enabled)\r\n   Active: inactive (dead)\r\nroot@118-27-24-70:~\/auto-deploy_ansible\/prepare#\r\nroot@118-27-24-70:~\/auto-deploy_ansible\/prepare#\r\n<\/code><\/pre>\n<h2>\u5f00\u59cb\u81ea\u52a8\u6267\u884c<\/h2>\n<p>\u4f7f\u7528reboot\u547d\u4ee4\u91cd\u65b0\u542f\u52a8\u64cd\u4f5c\u7cfb\u7edf\u3002\uff08\u5728\u901a\u8fc7PXE\u6784\u5efa\u4e4b\u540e\u5e94\u8be5\u901a\u8fc7\u91cd\u65b0\u542f\u52a8\u6765\u5b9e\u73b0\uff09<\/p>\n<h3>\u90e8\u7f72\u540e\u7684\u670d\u52a1\u72b6\u6001<\/h3>\n<p>\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u65b9\u5f0f\u78ba\u8a8dauto-deploy.service\u5df2\u7d93\u5b8c\u6210\u3002<br \/>\n\u203b\u5982\u524d\u6240\u8ff0\uff0c\u5982\u679c\u5931\u6557\uff0c\u5247\u72c0\u614b\u70bafailed\u3002<\/p>\n<pre class=\"post-pre\"><code>root@118-27-24-70:~# systemctl status auto-deploy.service\r\n\u25cf auto-deploy.service - Auto Deploy using Ansible.\r\n   Loaded: loaded (\/etc\/systemd\/system\/auto-deploy.service; disabled; vendor preset: enabled)\r\n   Active: inactive (dead)\r\n\r\nFeb 11 16:00:52 118-27-24-70 ansible-playbook[1195]: changed: [118-27-24-70]\r\nFeb 11 16:00:52 118-27-24-70 ansible-playbook[1195]: TASK [systemd : disable auto-deploy service] ***********************************\r\nFeb 11 16:00:53 118-27-24-70 ansible-playbook[1195]: changed: [118-27-24-70]\r\nFeb 11 16:00:53 118-27-24-70 ansible-playbook[1195]: TASK [apt : Only run \"update_cache=yes\"(apt-get update)] ***********************\r\nFeb 11 16:00:55 118-27-24-70 ansible-playbook[1195]: changed: [118-27-24-70]\r\nFeb 11 16:00:55 118-27-24-70 ansible-playbook[1195]: TASK [libvirt : Install libvirt-bin] *******************************************\r\nFeb 11 16:01:08 118-27-24-70 ansible-playbook[1195]: changed: [118-27-24-70]\r\nFeb 11 16:01:08 118-27-24-70 ansible-playbook[1195]: PLAY RECAP *********************************************************************\r\nFeb 11 16:01:08 118-27-24-70 ansible-playbook[1195]: 118-27-24-70               : ok=6    changed=4    unreachable=0    failed=0\r\nFeb 11 16:01:08 118-27-24-70 systemd[1]: Started Auto Deploy using Ansible..\r\nroot@118-27-24-70:~#\r\n<\/code><\/pre>\n<h3>Ansible\u65e5\u5fd7<\/h3>\n<p>\u6211\u67e5\u770b\u4e86\u5728ansible.cfg\u4e2d\u5b9a\u4e49\u7684\u65e5\u5fd7\uff0c\u53d1\u73b0\u6ca1\u6709\u5931\u8d25\u7684\u8bb0\u5f55\u3002\u770b\u8d77\u6765\u5f88\u4e0d\u9519\uff08\u9676\u9189\uff09<\/p>\n<pre class=\"post-pre\"><code>root@118-27-24-70:~# cat \/tmp\/ansible_logfile\r\n2019-02-11 16:00:49,466 p=1195 u=root |  PLAY [auto-deploy] *************************************************************\r\n2019-02-11 16:00:49,478 p=1195 u=root |  TASK [Gathering Facts] *********************************************************\r\n2019-02-11 16:00:51,718 p=1195 u=root |  ok: [118-27-24-70]\r\n2019-02-11 16:00:51,736 p=1195 u=root |  TASK [common : debug messages] *************************************************\r\n2019-02-11 16:00:51,861 p=1195 u=root |  ok: [118-27-24-70] =&gt; {\r\n    \"msg\": \"auto deploy start.\"\r\n}\r\n2019-02-11 16:00:51,878 p=1195 u=root |  TASK [common : sample template 001] ********************************************\r\n2019-02-11 16:00:52,461 p=1195 u=root |  changed: [118-27-24-70]\r\n2019-02-11 16:00:52,477 p=1195 u=root |  TASK [systemd : disable auto-deploy service] ***********************************\r\n2019-02-11 16:00:53,243 p=1195 u=root |  changed: [118-27-24-70]\r\n2019-02-11 16:00:53,259 p=1195 u=root |  TASK [apt : Only run \"update_cache=yes\"(apt-get update)] ***********************\r\n2019-02-11 16:00:55,654 p=1195 u=root |  changed: [118-27-24-70]\r\n2019-02-11 16:00:55,671 p=1195 u=root |  TASK [libvirt : Install libvirt-bin] *******************************************\r\n2019-02-11 16:01:08,084 p=1195 u=root |  changed: [118-27-24-70]\r\n2019-02-11 16:01:08,091 p=1195 u=root |  PLAY RECAP *********************************************************************\r\n2019-02-11 16:01:08,091 p=1195 u=root |  118-27-24-70               : ok=6    changed=4    unreachable=0    failed=0\r\nroot@118-27-24-70:~#\r\n<\/code><\/pre>\n<h3>\u8cc7\u6750\u4e0a\u7684\u91cd\u9ede 001<\/h3>\n<p>apt\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u6210\u529f\u3057\u305f\u306e\u306f\u3084\u306f\u308a\u5927\u304d\u3044\u3067\u3059\u3002<br \/>\nchef\u306a\u3069\u3068\u7af6\u5408\u3057\u3066\u3044\u305f\u304c\u3001apt-daily-upgrade.time\u306a\u3069\u306e\u81ea\u52d5\u3067apt\u304c\u81ea\u52d5\u7684\u306b<br \/>\n\u52d5\u4f5c\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u3068\u7af6\u5408\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u306f\u3001systemd\u306e\u8a2d\u5b9a\u306e\u826f\u3044\u70b9\u3067\u3059\u3002<br \/>\n\u30ed\u30b0\u4e0a\u3067\u3082\u3001\u554f\u984c\u306a\u304flibvirt-bin\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>2019-02-11 16:00:55,671 p=1195 u=root |  TASK [libvirt : Install libvirt-bin] *******************************************\r\n2019-02-11 16:01:08,084 p=1195 u=root |  changed: [118-27-24-70]\r\n<\/code><\/pre>\n<h3>002\u7684\u5173\u952e\u70b9\u5728\u4e8e\u4f9b\u5e94\u6750\u6599\u3002<\/h3>\n<p>\u5173\u95ed\u4e86\u81ea\u52a8\u90e8\u7f72\u670d\u52a1\u3002<br \/>\n\u8fd9\u662f\u4e3a\u4e86\u5728\u64cd\u4f5c\u7cfb\u7edf\u5b89\u88c5\u540e\u91cd\u65b0\u542f\u52a8\u65f6\u8fdb\u884c\u90e8\u7f72\u800c\u8bbe\u7f6e\u7684\uff0c\u90e8\u7f72\u540e\u4e0d\u4f1a\u81ea\u52a8\u542f\u52a8\u7684\u914d\u7f6e\u3002<br \/>\n\u6216\u8bb8\u4e5f\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u5c4f\u853d\u8bbe\u7f6e\uff0c\u4f46\u6211\u9009\u62e9\u4e86\u7981\u7528\u8bbe\u7f6e\uff08\u8fd9\u53d6\u51b3\u4e8e\u7528\u9014\u548c\u4e2a\u4eba\u559c\u597d\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code>root@118-27-24-70:~# systemctl is-enabled auto-deploy.service\r\ndisabled\r\nroot@118-27-24-70:~#\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 \u7531\u4e8e\u5185\u5bb9\u8f83\u957f\uff0c\u6700\u597d\u67e5\u9605\u76ee\u5f55\u3002 \u76ee\u6807 \u5728\u5927\u91cf\u8bbe\u7f6e\u8282\u70b9\u65f6\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\u80fd\u8ba9\u8fd9\u4e2a\u8fc7\u7a0b\u53d8\u5f97\u66f4\u8f7b\u677e\u4e00\u70b9\u5462\uff1f \u6bd4\u5982\uff0c\u64cd [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-42530","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c\" \/>\n<meta property=\"og:description\" content=\"\u6982\u8ff0 \u7531\u4e8e\u5185\u5bb9\u8f83\u957f\uff0c\u6700\u597d\u67e5\u9605\u76ee\u5f55\u3002 \u76ee\u6807 \u5728\u5927\u91cf\u8bbe\u7f6e\u8282\u70b9\u65f6\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\u80fd\u8ba9\u8fd9\u4e2a\u8fc7\u7a0b\u53d8\u5f97\u66f4\u8f7b\u677e\u4e00\u70b9\u5462\uff1f \u6bd4\u5982\uff0c\u64cd [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-15T21:50:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T12:30:20+00:00\" \/>\n<meta name=\"author\" content=\"\u79d1, \u96c5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u96c5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/\",\"name\":\"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-01-15T21:50:02+00:00\",\"dateModified\":\"2024-04-29T12:30:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\",\"name\":\"\u79d1, \u96c5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u96c5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c","og_description":"\u6982\u8ff0 \u7531\u4e8e\u5185\u5bb9\u8f83\u957f\uff0c\u6700\u597d\u67e5\u9605\u76ee\u5f55\u3002 \u76ee\u6807 \u5728\u5927\u91cf\u8bbe\u7f6e\u8282\u70b9\u65f6\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\u80fd\u8ba9\u8fd9\u4e2a\u8fc7\u7a0b\u53d8\u5f97\u66f4\u8f7b\u677e\u4e00\u70b9\u5462\uff1f \u6bd4\u5982\uff0c\u64cd [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-01-15T21:50:02+00:00","article_modified_time":"2024-04-29T12:30:20+00:00","author":"\u79d1, \u96c5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u96c5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/","name":"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-01-15T21:50:02+00:00","dateModified":"2024-04-29T12:30:20+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728\u64cd\u4f5c\u7cfb\u7edf\u542f\u52a8\u65f6\u4f7f\u7528systemd\uff0c\u6267\u884cansible\u64cd\u4f5c"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a","name":"\u79d1, \u96c5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","caption":"\u79d1, \u96c5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e5%90%af%e5%8a%a8%e6%97%b6%e4%bd%bf%e7%94%a8systemd%ef%bc%8c%e6%89%a7%e8%a1%8cansible%e6%93%8d%e4%bd%9c%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=42530"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42530\/revisions"}],"predecessor-version":[{"id":87478,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/42530\/revisions\/87478"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=42530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=42530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=42530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}