{ "version": "https://jsonfeed.org/version/1", "title": "Ansible", "description": "\u8d85\u7ea7\u7b80\u6d01\u7684\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\u3002", "home_page_url": "go/ansible", "feed_url": "feed/ansible.json", "icon": "https://cdn.v2ex.com/navatar/be31/59ad/662_large.png?m=1406116039", "favicon": "https://cdn.v2ex.com/navatar/be31/59ad/662_normal.png?m=1406116039", "items": [ { "author": { "url": "member/MasterMonkey", "name": "MasterMonkey", "avatar": "https://cdn.v2ex.com/gravatar/1b67ada2925db6de62dccb1620a2b6fc?s=73&d=retro" }, "url": "t/1194715", "date_modified": "2026-02-28T01:45:03+00:00", "content_html": "

\u4e0a\u56fe\u4e0a\u6548\u679c:

\n

\"\"

\n

\u8bf4\u660e\uff0c\u6267\u884c\u7ed3\u679c\u662f\u9519\u7684\uff0c\u56e0\u4e3a\u7528\u7684\u4eba\u9020\u6570\u636e\uff0c\u7a0b\u5e8f\u662f\u65e5\u5e38\u4f7f\u7528\u7684

\n

\u9879\u76ee\uff0c\u6b22\u8fce\u6765\u5171\u521b: https://github.com/congzhangzh/ansible-tui/

\n", "date_published": "2026-02-28T01:43:03+00:00", "title": "\u4e00\u4e2a tui \u7684 ansible playbook \u6267\u884c\u5f15\u64ce\uff0c\u6b22\u8fce\u4f7f\u7528", "id": "t/1194715" }, { "author": { "url": "member/eyebrowkang", "name": "eyebrowkang", "avatar": "https://cdn.v2ex.com/avatar/b24c/9874/761097_large.png?m=1754355956" }, "url": "t/1188914", "title": "\u5206\u4eab\u81ea\u5df1\u5199\u7684\u4e00\u4e2a ansible role\uff0c\u7528\u6765\u90e8\u7f72 meilisearch", "id": "t/1188914", "date_published": "2026-01-28T01:36:17+00:00", "content_html": "

\u4ed3\u5e93\u5730\u5740\uff1ahttps://github.com/eyebrowkang/ansible-role-meilisearch

\n

\u901a\u8fc7 systemd \u670d\u52a1\u7684\u5f62\u5f0f\u90e8\u7f72\u7ba1\u7406\uff0c\u7136\u540e\u628a\u5347\u7ea7\u64cd\u4f5c\u4e5f\u96c6\u6210\u4e86\uff0c\u5982\u679c\u6570\u636e\u91cf\u4e0d\u662f\u7279\u522b\u5927\uff0c\u90a3\u4e48\u6574\u4e2a\u5b89\u88c5\u4ee5\u53ca\u540e\u7eed\u5347\u7ea7\u8fc7\u7a0b\u5e94\u8be5\u662f\u5f88\u8212\u670d\u7684\u3002

\n

\u8fd9\u662f\u6211\u5f00\u53d1\u7684\u7b2c\u4e00\u4e2a role \uff0c\u7528 AI \u90a3\u662f\u80af\u5b9a\u7684\u4e86\uff0c\u4e0d\u8fc7\u4e5f\u662f\u8fdb\u884c\u4e86\u6bd4\u8f83\u5145\u5206\u7684\u6d4b\u8bd5\uff0c\u6700\u4e3b\u8981\u7684\u662f\u5bf9\u6574\u4e2a\u6d41\u7a0b\u719f\u6089\u4e86\u3002\u719f\u6089\u4e86\u4ee5\u540e\uff0c\u6108\u53d1\u559c\u6b22 ansible \u4e86\uff0c\u5f00\u53d1\u6d4b\u8bd5\u5145\u5206\u7684\u524d\u63d0\u4e0b\uff0c\u540e\u7eed\u4f7f\u7528\u975e\u5e38\u53ef\u9760\uff0c\u5e42\u7b49\u5e26\u6765\u7684\u5b89\u5168\u611f\u771f\u662f\u65e0\u4e0e\u4f26\u6bd4\u7684

\n" }, { "author": { "url": "member/FrankAdler", "name": "FrankAdler", "avatar": "https://cdn.v2ex.com/gravatar/783e61f6fe72b7f9527e20d21542369a?s=73&d=retro" }, "url": "t/1104951", "date_modified": "2025-01-14T04:11:40+00:00", "content_html": "

\u8ddf\u7740 chatgpt \u5199\u4e86\u70b9 python \uff0c\u5c01\u88c5\u4e86 pct qm \u547d\u4ee4\u7ed9 ansible \u7528\uff0c\u7528 pvesh \u547d\u4ee4\u751f\u6210\u52a8\u6001\u4e3b\u673a\u5217\u8868\uff0c\u5206\u4e3a lxc \u7ec4\u548c vm \u7ec4\u3002

\n

pct \u8c03\u7528\u793a\u4f8b\uff1a

\n
 - name: Use USTC mirrors\n pct:\n cmd: \"exec\"\n host: \"{{ inventory_hostname }}\"\n extra_args: \"sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories\"\n\n
\n

\u4ed3\u5e93\u4ee3\u7801\uff1a https://b64s.uk/._RfMW0hMR6Qd9sfCWtiBNzD29yQ2EqgricfX9birZyDB5efBOxEV

\n

\u57fa\u672c\u4e0a\u5c31\u662f\u8c03\u7528 pct \u547d\u4ee4\uff0c\u6bd4\u5982\u5b89\u88c5 memos\uff1a

\n

ansible-playbook -i pve apps_memos.yml

\n

\u6bd4\u5982\u6279\u91cf\u66f4\u65b0\u5168\u90e8 vm \u3001lxc \uff0c\u8fd9\u4e2a\u7279\u6b8a\u70b9\u5e94\u8be5\u673a\u578b\u591a\uff0c\u76f4\u63a5\u5199\u4e86\u4e2a\u901a\u7528\u811a\u672c\u590d\u5236\u5230\u8fdc\u7a0b\u6267\u884c\uff1a

\n

\u53ea\u66f4\u65b0 vm\uff1a\nSTATUS=running ansible-playbook -i pve update.yml --limit vm

\n

\u53ea\u66f4\u65b0 lxc\uff1a\nSTATUS=running ansible-playbook -i pve update.yml --limit lxc

\n

\u53bb\u6389 limit \u5c31\u662f\u5168\u90e8\u66f4\u65b0\u3002

\n

\u6ca1\u548b\u5199\u8fc7 python \uff0cansible \u4e5f\u662f\u8fd9\u51e0\u5929\u624d\u5f00\u59cb\u719f\u6089\uff0c\u6709\u95ee\u9898\u7684\u5730\u65b9\u6b22\u8fce\u6307\u51fa\u3002

\n", "date_published": "2025-01-14T04:09:20+00:00", "title": "\u6709\u4eba\u540c\u65f6\u7528 PVE \u548c Ansible \u5417\uff0c\u7528 Ansible \u6765\u7ba1\u7406 PVE \u4e0a\u7684\u5e94\u7528\u8fd8\u633a\u65b9\u4fbf", "id": "t/1104951" }, { "author": { "url": "member/FkingMan", "name": "FkingMan", "avatar": "https://cdn.v2ex.com/gravatar/30df7c6c737844807c968df567d3d529?s=73&d=retro" }, "url": "t/1050887", "title": "\u5173\u4e8e\u300a\u5927\u6559\u5802\u4e0e\u96c6\u5e02\u4e2d\u300b2.12 \u8282\u7684\u7591\u95ee", "id": "t/1050887", "date_published": "2024-06-19T07:44:49+00:00", "content_html": "

\u5728\u8fd9\u4e00\u8282\u5f53\u4e2d\u6709\u4e00\u53e5\u603b\u7ed3\u201c\u672a\u6765\u8f6f\u4ef6\u4ea7\u4e1a\u7684\u7ecf\u6d4e\u5173\u952e\u662f\u670d\u52a1\u4ef7\u503c\u3002\u201d \u8fd9\u53e5\u8bdd\u4e0d\u662f\u5f88\u7406\u89e3\u3002\u60f3\u542c\u542c\u5927\u5bb6\u5bf9\u8fd9\u6bb5\u8bdd\u7684\u7406\u89e3

\n" }, { "author": { "url": "member/FkingMan", "name": "FkingMan", "avatar": "https://cdn.v2ex.com/gravatar/30df7c6c737844807c968df567d3d529?s=73&d=retro" }, "url": "t/1042034", "title": "\u6709\u65f6\u5019 bug \u51fa\u73b0\u7684\u76ee\u6807\u73af\u5883\u662f\u5176\u4ed6\u53d1\u884c\u7248\u672c\uff0c\u7528 vagrant \u8fd8\u662f docker \u6765\u865a\u62df\u73af\u5883\u6bd4\u8f83\u597d\uff1f", "id": "t/1042034", "date_published": "2024-05-19T08:33:53+00:00", "content_html": "

\u6700\u8fd1\u60f3\u53c2\u4e0e\u5230 ansible \u5f00\u6e90\u9879\u76ee\u4e2d\uff0c\u5c31\u627e\u4e86\u4e9b p3,p4 \u7684 bug \u53bb\u4fee\u4fee\uff0c\u6709\u65f6\u5019 bug \u51fa\u73b0\u7684\u76ee\u6807\u73af\u5883\u662f\u5176\u4ed6\u53d1\u884c\u7248\u672c\uff0c\u7528 vagrant \u8fd8\u662f docker \u6765\u865a\u62df\u73af\u5883\u6bd4\u8f83\u597d\uff1f

\n" }, { "author": { "url": "member/Hopetree", "name": "Hopetree", "avatar": "https://cdn.v2ex.com/avatar/38cb/fd52/265542_large.png?m=1714960392" }, "url": "t/967700", "title": "yum install -y docker-ce-18.09.9-3.el7 \u8fd8\u8ba9\u6211\u786e\u8ba4\uff1f\u600e\u4e48\u89c4\u907f\u8fd9\u4e2a\u786e\u8ba4", "id": "t/967700", "date_published": "2023-08-23T09:23:25+00:00", "content_html": "

\u5982\u9898\uff0c\u6211\u5728\u811a\u672c\u4e2d\u4f7f\u7528 yum \u547d\u4ee4\u5b89\u88c5 docker \uff0c\u6211\u660e\u660e\u90fd\u52a0\u4e86-y \uff0c\u4e3a\u5565\u8fd8\u662f\u8981\u8ba9\u6211\u786e\u8ba4\uff1f\n\"\"

\n

\u8fd9\u4e2a\u4e5f\u5bfc\u81f4\u4e86\u6211\u4f7f\u7528 ansible \u5b89\u88c5\u7684\u65f6\u5019\u4e5f\u4f1a\u5931\u8d25\uff0c\u6211\u7684 ansible \u7f16\u6392\u5982\u4e0b

\n
- name: add docker repo\n shell: yum-config-manager --add-repo {{ docker.repo }}\n\n- name: install docker-ce\n yum: name={{ docker.version }} state=present update_cache=True\n
\n

\u8bf7\u95ee\u5728 shell \u811a\u672c\u548c ansible \u4e2d\u5206\u522b\u5982\u4f55\u907f\u514d\u8fd9\u4e2a\u786e\u8ba4\u7684\u64cd\u4f5c\uff1f

\n" }, { "author": { "url": "member/leiuu", "name": "leiuu", "avatar": "https://cdn.v2ex.com/gravatar/117e03f151006cb9f7751d48322e3311?s=73&d=retro" }, "url": "t/814262", "title": "ansible sudo su - \u4e0d\u652f\u6301", "id": "t/814262", "date_published": "2021-11-09T13:52:56+00:00", "content_html": "

\u8bf7\u6559 ansible \u5927\u4f6c\u4eec\u3002

\n

\u7b2c\u4e00\u6b21\u63a5\u89e6 ansible \u3002

\n

\u9700\u6c42\u5982\u4e0b\uff1a

\n

\u5047\u8bbe\u6211\u7684\u7528\u6237\u53ea\u80fd\u662f\u65e0\u5bc6\u7801\u5207\u6362\u5230 root \uff0c\u600e\u4e48\u7528 ansible ad-hoc \u65b9\u5f0f\u8fdc\u7a0b\u6267\u884c\u9700\u8981 root \u7684\u547d\u4ee4\u3002

\n

\u6211 foo \u7528\u6237\u6743\u9650\uff1a

\n
foo ALL=(ALL) NOPASSWD: /bin/su\n
\n

\u8ba1\u5212\u6267\u884c\uff08\u6279\u91cf\u66f4\u65b0 hosts \u6587\u4ef6\uff09\uff1a

\n
ansible --private-key xxx -u foo all -m copy -a \"src=http://www.v2ex.com/etc/hosts dest=/etc/hosts\" -become --become-user root --become-method 'sudo'\n
\n

\u62a5\u9519\uff1a

\n
1.2.3.4 | FAILED! => {\n \"msg\": \"Missing sudo password\"\n}\n
\n

\u8c37\u6b4c\u7684\u65b9\u6cd5\u57fa\u672c\u8bd5\u8fc7\u4e86\u4e0d\u592a\u594f\u6548\u3002\u636e\u8bf4 playbook \u53ef\u4ee5\uff0c\u4f46\u662f\u76ee\u524d\u60f3\u4e86\u89e3 ad-hoc \u65b9\u5f0f\u662f\u5426\u80fd\u76f4\u63a5\u652f\u6301\u3002

\n" }, { "author": { "url": "member/firejoke", "name": "firejoke", "avatar": "https://cdn.v2ex.com/avatar/a098/a71b/77871_large.png?m=1636019138" }, "url": "t/813100", "title": "\u5173\u4e8e AWX \u6267\u884c ansible \u7684\u539f\u7406\u4e0d\u89e3\u7684\u5730\u65b9", "id": "t/813100", "date_published": "2021-11-04T10:19:00+00:00", "content_html": "

\u6700\u8fd1\u4e00\u76f4\u5728\u5199\u4e00\u4e2a\u7ed9\u5c0f\u767d\u7528\u7684\u8fd0\u7ef4\u5de5\u5177\uff0c\u4f7f\u7528 django+ansible \u3002
\n\u7ea2\u5e3d\u672c\u8eab\u6709\u4e00\u4e2a\u8fd9\u6837\u7684\u9879\u76ee\uff0c\u6536\u8d39\u7684\u662f Tower \uff0c\u5f00\u6e90\u7684\u7248\u672c\u53eb AWX \u3002
\n\u65e2\u7136\u6709\u73b0\u6210\u7684\uff0c\u5c31\u60f3\u770b\u770b\u4ed6\u662f\u600e\u4e48\u505a\u7684\u3002

\n

\u9996\u5148\u56e0\u4e3a ansible \u6838\u5fc3\u529f\u80fd play \u662f\u57fa\u4e8e\u6587\u4ef6\u548c role \u76ee\u5f55\u6765\u6267\u884c\u53ef\u590d\u7528\u7684\u4efb\u52a1\uff0c\u800c\u76ee\u6807\u673a\u5668\u7ec4\uff08 inventory \uff09\u4e5f\u662f\u8bb0\u5f55\u5728\u6587\u4ef6\u5185\u7684\u3002
\n\u6700\u7b80\u5355\u529e\u6cd5\uff0c\u5c31\u662f\u6587\u4ef6\u8bfb\u53d6\u548c\u89e3\u6790\uff0c\u7136\u540e\u6620\u5c04\u5230\u754c\u9762\u4e0a\uff0c\u4f46\u8fd9\u5176\u4e2d\u8fd8\u6d89\u53ca play \u6587\u4ef6\u5185\u7684\u5404\u79cd\u53d8\u91cf\u548c\u5173\u952e\u8bcd\uff0c\u8fd8\u6709\u9891\u7e41\u7684\u6587\u4ef6\u64cd\u4f5c\uff0c\u4e0d\u8ba4\u4e3a\u662f\u4e00\u4e2a\u6700\u4f73\u7684\u89e3\u51b3\u65b9\u6848\u3002\n\u6bd4\u8f83\u5408\u7406\u7684\u529e\u6cd5\uff0c\u662f\u81ea\u884c\u5f00\u53d1 ansible \u6a21\u5757\u6216\u63d2\u4ef6\uff0c\u4ee5\u5b9e\u73b0\u4ece\u4f60\u7684 web api \u83b7\u53d6\u8d44\u6e90\u3002

\n
\n

inventory \u7684\u89e3\u51b3\u529e\u6cd5\u6bd4\u8f83\u7b80\u5355\uff0c\u5199\u4e00\u4e2a inventory \u63d2\u4ef6\uff0c\u4ece\u4f60\u7684 api \u63a5\u53e3\u83b7\u53d6\u4e3b\u673a\u5217\u8868\uff0c\u7136\u540e\u7ec4\u88c5\u6210 ansible \u80fd\u8bc6\u522b\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5b9e\u9645\u4e0a AWX \u7684\u6e90\u7801\u91cc\u4e5f\u662f\u5199\u4e86\u8fd9\u6837\u7684\u63d2\u4ef6InventoryModule(BaseInventoryPlugin)\u3002
\n\u8fd9\u4e2a\u63d2\u4ef6\u4f7f\u7528\u4e86 awx \u5199\u7684\u53e6\u4e00\u4e2a module_util\uff1aControllerModule(AnsibleModule)\uff0c\u7528\u6765\u4ece\u4ed6\u7684 web api \u91cc\u83b7\u53d6\u8d44\u6e90\u3002

\n
...\nmodule = ControllerAPIModule(argument_spec={}, direct_params=module_params, error_callback=handle_error, warn_callback=self.warn_callback)\n...\ninventory = module.get_endpoint(inventory_url, data={'hostvars': '1', 'towervars': '1', 'all': '1'})['json']\n
\n
\n

\u800c play \u7684\u6267\u884c\uff0cawx \u5219\u662f\u4f7f\u7528\u4e86ansible-runner\u8fd9\u4e2a\u5e93\uff0c\u8fd9\u4e2a\u5e93\u53ef\u4ee5\u901a\u8fc7\u8bfb\u53d6\u4e00\u4e2a\u56fa\u5b9a\u7ed3\u6784\u7684\u76ee\u5f55\u76f4\u63a5\u6267\u884c play \uff0c\u4e5f\u63d0\u4f9b python \u63a5\u53e3\u53ef\u4ee5\u4f20\u9012 play \u7684\u5fc5\u8981\u53c2\u6570\u6765\u6267\u884c play \u3002
\nawx \u662f\u8ba9\u7528\u6237\u81ea\u884c\u63d0\u4f9b\u4e00\u4e2a play \u6587\u4ef6\uff0c\u7136\u540e\u4fdd\u5b58\u5230\u56fa\u5b9a\u7684\u76ee\u5f55\u4e0b\uff0cinventory \u4e5f\u662f\u4fdd\u5b58\u5230\u56fa\u5b9a\u4f4d\u7f6e\u7684\u6587\u4ef6\u91cc\uff0c\u7136\u540e\u8c03\u7528 ansible-runner \u6267\u884c\u3002

\n
params = {\n 'ident': self.instance.id,\n 'private_data_dir': private_data_dir,\n 'playbook': self.build_playbook_path_relative_to_cwd(\n self.instance, private_data_dir\n ),\n 'inventory': self.build_inventory(self.instance, private_data_dir),\n 'passwords': expect_passwords,\n 'envvars': env,\n 'settings': {\n 'job_timeout': self.get_instance_timeout(self.instance),\n 'suppress_ansible_output': True,\n },\n}\n...\nif isinstance(self.instance, SystemJob):\n res = ansible_runner.interface.run(\n project_dir=settings.BASE_DIR,\n event_handler=self.event_handler,\n finished_callback=self.finished_callback,\n status_handler=self.status_handler,\n **params,\n )\n...\n
\n

\u8fd9\u4e2a task \u7684\u6267\u884c\u662f\u901a\u8fc7 Job \u6a21\u578b\u4fdd\u5b58\u65f6\u7684\u4fe1\u53f7\u6765\u51b3\u5b9a\uff0ctask \u7684\u6267\u884c\u662f\u7ef4\u62a4\u5728\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u5185\uff08\u8fd9\u91cc\u8fd8\u6ca1\u6478\u900f\uff0c\u53ea\u5927\u81f4\u77e5\u9053\u662f\u901a\u8fc7\u4fe1\u53f7\u5f15\u53d1\u6267\u884c\uff09

\n
\n

\u4e0d\u89e3\u7684\u5730\u65b9\u5728\u4e8e\uff1a

\n
    \n
  1. \u65e2\u7136\u5df2\u7ecf\u5199\u4e86\u4e00\u4e2a Inventory \u63d2\u4ef6\uff0c\u4e3a\u4ec0\u4e48\u8fd9\u91cc\u8fd8\u8981\u628a inventory \u4fdd\u5b58\u5230\u6587\u4ef6\u5185\u5462\uff1f
  2. \n
  3. \u4e3a\u4ec0\u4e48\u4e0d\u628a play \u4ee5\u53ca task \uff0crole \uff0chandler \uff0cblock \u8fd9\u4e9b Play \u91cc\u7684\u529f\u80fd\u4e5f\u8bbe\u8ba1\u6210\u6a21\u578b\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u91cc\u5462\uff1f\u800c\u662f\u8981\u7528\u6237\u81ea\u5df1\u5199\uff1f
  4. \n
\n" }, { "author": { "url": "member/zhoudaiyu", "name": "zhoudaiyu", "avatar": "https://cdn.v2ex.com/avatar/b75f/9ee0/163414_large.png?m=1682659533" }, "url": "t/766156", "date_modified": "2021-03-29T06:45:02+00:00", "content_html": "

\u5148\u8bf4\u4e00\u4e0b\u573a\u666f\uff1a\u6211\u4eec\u60f3\u505a\u4e2a\u81ea\u52a8\u5316\u5e73\u53f0\u64cd\u4f5c\u4e2d\u95f4\u4ef6\uff0c\u5305\u62ec\u5b89\u88c5\u3001\u542f\u505c\u3001\u914d\u7f6e\u63a8\u9001\u7b49\u7b49\uff0c\u81ea\u52a8\u5316\u5de5\u5177\u57fa\u4e8e ansible \u3002\u6211\u4eec\u60f3\u628a ansible-playbook \u7684\u6587\u4ef6\u653e\u5728 git \u4e0a\u7ba1\u7406\uff0c\u6bcf\u6b21\u90fd\u628a\u6587\u4ef6\u62c9\u5230\u672c\u5730\u518d\u6267\u884c playbook\uff0c\u8fd9\u6837\u4e5f\u4e0d\u9700\u8981\u81ea\u5df1\u5b9e\u73b0\u7248\u672c\u7ba1\u7406\u4e86\uff0c\u4e5f\u6bd4\u653e\u5728\u672c\u5730\u5b89\u5168\u4e00\u4e9b\u3002\u8fd9\u6837\u5c31\u6709\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u7684 gitlab \u7248\u672c\u548c\u597d\u50cf\u6709\u70b9\u8001\uff0cgitlab \u7684 LFS \u4e0d\u652f\u6301\uff0c\u4e4b\u524d\u6709\u4eba\u4f20 200m \u7684\u6587\u4ef6\u5c31\u80fd\u628a\u73b0\u5728\u7528\u7684 gitlab \u5361\u4f4f\u3002\u53e6\u5916\u6211\u4eec\u8fd8\u6709\u4e00\u5957 minio \u4e13\u95e8\u505a\u5bf9\u8c61\u5b58\u50a8\uff0c\u4f46\u662f\u6211\u4eec\u9886\u5bfc\u4e0d\u60f3\u5f15\u5165\u8fc7\u591a\u7684\u5176\u4ed6\u7ec4\u4ef6\uff0c\u6240\u4ee5\u8fd9\u4e2a\u65b9\u6848 pass \u4e86\uff08\u867d\u7136\u6211\u89c9\u5f97\u8fd9\u4e2a\u65b9\u6848\u5bf9 gitlab \u597d\uff09\u3002\u5927\u5bb6\u8fd8\u6709\u5565\u601d\u8def\u5417\uff1f

\n", "date_published": "2021-03-29T06:32:42+00:00", "title": "ansible-playbook \u7684\u5267\u672c\u548c\u76f8\u5173\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u600e\u4e48\u5b58\u6bd4\u8f83\u597d\uff1f", "id": "t/766156" }, { "author": { "url": "member/zealinux", "name": "zealinux", "avatar": "https://cdn.v2ex.com/gravatar/97cec5ffbda3f47b2cd453cf10b78244?s=73&d=retro" }, "url": "t/739881", "title": "ansbile \u600e\u4e48\u628a\u8fde\u63a5\u7684\u76ee\u6807 HOST IP \u901a\u8fc7\u53d8\u91cf\u4f20\u9012\u8fc7\u53bb", "id": "t/739881", "date_published": "2020-12-29T03:08:48+00:00", "content_html": "

\u6bd4\u5982\uff1aansible-playbook \u65b0\u5efa\u4e00\u4e2a\u4efb\u52a1\uff0c

\n

\u5c31\u662f\u628a\u76ee\u6807 IP \u52a0\u5230\u76ee\u6807\u673a\u5668\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002\n\u4e3b\u8981\u4e0d\u77e5\u9053\u8be5\u600e\u4e48\u4f20\u9012\u8fd9\u4e2a\u53d8\u91cf\u3002

\n" }, { "author": { "url": "member/firejoke", "name": "firejoke", "avatar": "https://cdn.v2ex.com/avatar/a098/a71b/77871_large.png?m=1636019138" }, "url": "t/631554", "title": "ansible \u8fdc\u7a0b\u81ea\u52a8\u4ea4\u4e92\u5f0f\u547d\u4ee4\u7684\u54cd\u5e94", "id": "t/631554", "date_published": "2019-12-23T07:23:35+00:00", "content_html": "

\u56e0\u4e3a\u7ba1\u7406\u4e00\u822c\u90fd\u662f\u7528 ssh \u5bc6\u94a5\u8fde\u63a5\u8fdc\u7a0b\u4e3b\u673a, \u4f46\u8981\u83b7\u53d6 ssh \u5bc6\u94a5\u8fd8\u662f\u9700\u8981\u5148\u7528\u5bc6\u7801\u8fdc\u7a0b\u767b\u9646\u4e00\u6b21\u53bb\u751f\u6210\u548c\u83b7\u53d6\n\u4f46 ssh-keygen \u8fd9\u4e2a\u547d\u4ee4\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u547d\u4ee4, \u5982\u679c\u7528 psexec \u6a21\u5757\u6765\u505a\u54cd\u5e94\u5339\u914d, \u5219\u9700\u8981\u76ee\u6807\u4e3b\u673a\u5b89\u88c5 pypsexec \u5305, \u4f46\u6211\u5e76\u4e0d\u60f3\u5728\u90e8\u7f72\u670d\u52a1\u4e4b\u524d\u5728\u8fdc\u7a0b\u4e3b\u673a\u5b89\u88c5\u4efb\u4f55\u4f9d\u8d56, \u6240\u4ee5\u6539\u7528 shell \u6a21\u5757\n\u539f shell \u811a\u672c:

\n
if [ -f ~/.ssh/id_rsa.pub ]\nthen\n cat ~/.ssh/id_rsa.pub\nelif [ -f ~/.ssh/id_rsa ] && [ ! -f ~/.ssh/id_rsa.pub ]\nthen\n echo -e \"\\ny\\n\\n\\n\" | ssh-keygen -t rsa\n cat ~/.ssh/id_rsa.pub\nelse\n echo -e \"\\n\\n\\n\\n\" | ssh-keygen -t rsa\n cat ~/.ssh/id_rsa.pub\nfi\n
\n

\u6539\u6210 play

\n
- hosts: 192.168.8.128\n tasks:\n - name: create host ssh rsa\n shell: \n if [ -f ~/.ssh/id_rsa.pub ];then cat ~/.ssh/id_rsa.pub;elif [ -f ~/.ssh/id_rsa ] && [ ! -f ~/.ssh/id_rsa.pub ];then echo -e \"\\ny\\n\\n\\n\" | ssh-keygen -t rsa; cat ~/.ssh/id_rsa.pub;else echo -e \"\\n\\n\\n\\n\" | ssh-keygen -t rsa; cat ~/.ssh/id_rsa.pub; fi\n
\n

\u4f46\u4f3c\u4e4e echo -e \"\\ny\\n\\n\\n\" | ssh-keygen -t rsa; \u8fd9\u4e00\u53e5\u5e76\u6ca1\u6709\u8d77\u6548\u679c,\n\u6709\u9047\u5230\u8fc7\u8fd9\u79cd\u95ee\u9898\u7684\u5417?\n\u5982\u679c\u8fd8\u662f\u4e0d\u884c\u7684\u8bdd, \u90a3\u5c31\u53ea\u80fd script \u6a21\u5757\u4f20\u9001\u811a\u672c, \u6216\u8005\u7528 paramiko \u5c01\u88c5\u4e00\u4e2a, \u4e4b\u524d\u5728\u5176\u4ed6\u9879\u76ee\u7528\u7684\u662f fabric, \u4f46\u8fd9\u4e2a\u60f3\u7528 ansible \u505a

\n" }, { "author": { "url": "member/lewin5", "name": "lewin5", "avatar": "https://cdn.v2ex.com/avatar/0a01/8319/409687_large.png?m=1559804485" }, "url": "t/579294", "title": "jenkins \u548c ansible \u5728\u4e0d\u540c\u670d\u52a1\u5668\uff0c\u60f3\u5728 jenkins \u914d\u7f6e\u8fdc\u7a0b ansible \u6765\u8c03\u7528\u5bf9\u5e94 playbook \u548c hosts \u53ef\u4ee5\u5417\uff1f", "id": "t/579294", "date_published": "2019-07-02T06:29:42+00:00", "content_html": "

\u73b0\u5728\u60f3\u7528 ansible \u6765\u7f16\u6392 docker\uff0cjenkins \u6709 ansible plugin\uff0c\u4f46\u662f\u96c6\u6210\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\uff0c\u73b0\u5728\u60f3\u5206\u79bb\u4e0d\u8026\u5408\u5728\u4e00\u53f0\u673a\u5668\u4e0a\uff0cjenkins \u8fdc\u7a0b\u8c03\u7528\u670d\u52a1\u5668\u4e0a ansible \u600e\u4e48\u5f04\uff1f

\n" }, { "author": { "url": "member/fanne", "name": "fanne", "avatar": "https://cdn.v2ex.com/avatar/c074/af84/170999_large.png?m=1483084754" }, "url": "t/552597", "title": "ansible api \u91cc\u9762\u7684 ad-hoc \u548c playbook \u600e\u4e48\u505a\u5f02\u6b65", "id": "t/552597", "date_published": "2019-04-06T16:12:00+00:00", "content_html": "

\u5728\u76f4\u63a5\u4f7f\u7528 ansible \u65f6\u5019\u6709-B -p \u53c2\u6570\u53ef\u4ee5\u542f\u7528\u5f02\u6b65\u64cd\u4f5c\uff0c\u7136\u540e\u8fd4\u56de\u4e00\u4e2a job_id \u503c

\n
[root@master ansible]# ansible node1 -B 3600 -P 0 -m yum -a \"name=ansible\" -vv\nUsing /etc/ansible/ansible.cfg as config file\nMETA: ran handlers\n192.168.77.129 | SUCCESS => {\n \"ansible_job_id\": \"23974611070.37468\", \n \"changed\": true, \n \"finished\": 0, \n \"results_file\": \"/root/.ansible_async/23974611070.37468\", \n \"started\": 1\n}\n\n[root@master ansible]# ansible node1 -m async_status -a \"jid=23974611070.37468\"\n192.168.77.129 | SUCCESS => {\n \"ansible_job_id\": \"23974611070.37468\", \n \"changed\": false, \n \"finished\": 1, \n \"msg\": \"\", \n \"rc\": 0, \n \"results\": [\n \"ansible-2.3.1.0-1.el6.noarch providing ansible is already installed\"\n ]\n}\n
\n

playbook \u4e5f\u662f\u53ef\u4ee5\u6307\u5b9a\u53c2\u6570\u542f\u7528\u5f02\u6b65\u7684\u3002

\n
# asynctest.yml\n---\n\n- hosts: node1\n tasks:\n - shell: sleep 100 && hostname\n async: 100\n poll: 0\n register: result\n\n - debug: var=result\n\n - async_status: jid={{ result.ansible_job_id }}\n register: job_result\n until: job_result.finished\n retries: 30\n
\n

\u90a3\u4e48\u5728 ansible api \u91cc\u5bf9\u4e8e ad-hoc \u548c playbook \u600e\u4e48\u542f\u7528\u8fd9\u4e2a\u5f02\u6b65\u4efb\u52a1\u7684\uff0c\u4e0d\u7136\u9875\u9762\u6709\u65f6\u5019\u8981\u5361\u597d\u4e45\u5728\u90a3\u7684\u3002

\n
# create play with tasks\nplay_source = dict(\n name = \"Ansible Play\",\n hosts = 'all', # \u8fd9\u91cc\u6307\u5b9a all\n gather_facts = 'no',\n tasks = [\n dict(action=dict(module='shell', args='ls'), register='shell_out'),\n dict(action=dict(module='debug', args=dict(msg='')))\n ]\n )\nplay = Play().load(play_source, variable_manager=variable_manager, loader=loader)\n
\n
# actually run it\ntqm = None\ntry:\n tqm = TaskQueueManager(\n inventory=inventory,\n variable_manager=variable_manager,\n loader=loader,\n optiOns=options,\n passwords=passwords,\n stdout_callback=results_callback, # Use our custom callback instead of the ``default`` callback plugin\n )\n result = tqm.run(play)\nfinally:\n if tqm is not None:\n tqm.cleanup()\n
\n

\u4e4b\u524d\u5728 django \u4e2d\u4f1a\u4f7f\u7528 celery \u505a\u4e00\u4e9b\u5f02\u6b65\u4efb\u52a1\u7684\u5de5\u4f5c\u3002

\n

\u73b0\u5728\u60f3\u4e86\u89e3 ansible \u5728\u4f7f\u7528 api \u65f6\u5019\uff0c\u6709\u6ca1\u81ea\u5df1\u7684\u4e00\u4e9b\u5f02\u6b65\u65b9\u5f0f\u7684\uff0c\u6211\u80fd\u5728 django \u4e2d\u76f4\u63a5\u4f7f\u7528\u7684\u3002

\n" }, { "author": { "url": "member/fanne", "name": "fanne", "avatar": "https://cdn.v2ex.com/avatar/c074/af84/170999_large.png?m=1483084754" }, "url": "t/539422", "title": "ansible \u6709\u6ca1\u6709\u5173\u4e8e passphrase \u7684\u914d\u7f6e\u7684", "id": "t/539422", "date_published": "2019-02-27T14:39:10+00:00", "content_html": "

\u516c\u53f8\u670d\u52a1\u5668\u767b\u5165\u4f7f\u7528\u4e86\u79d8\u94a5+passphrase \u65b9\u5f0f

\n

\u73b0\u5728 ansible \u8fde\u63a5\u7ba1\u7406\u670d\u52a1\u5668\u4e5f\u662f\u901a\u8fc7\u81ea\u5df1\u7684\u79d8\u94a5+passphrase \u8fdb\u884c\u64cd\u4f5c

\n

\u6211\u770b\u4e86\u6587\u6863\uff0c\u91cc\u9762\u6709\u5173\u4e8e\u5173\u4e8e\u79d8\u94a5\u8def\u5f84\u7684\u53c2\u6570ansible_ssh_private_key_file

\n

\u4e0d\u77e5\u9053\u79d8\u94a5+passphrase \u8981\u5982\u4f55\u5904\u7406\uff1f

\n" }, { "author": { "url": "member/fsckzy", "name": "fsckzy", "avatar": "https://cdn.v2ex.com/avatar/240e/a677/146275_large.png?m=1456493402" }, "url": "t/420111", "title": "Python \u5982\u4f55\u5c06 txt \u5bfc\u5165 excel\uff1f", "id": "t/420111", "date_published": "2018-01-04T10:43:11+00:00", "content_html": "

\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b\uff1a

\n" }, { "author": { "url": "member/yag", "name": "yag", "avatar": "https://cdn.v2ex.com/avatar/78a4/4f94/232780_large.png?m=1511170445" }, "url": "t/400512", "title": "\u521a\u521a\u5728\u62a2 S7 \u9e1f\u5de2\u7684\u7968\uff0c\u60f3\u5230\u4e00\u4e2a\u95ee\u9898\uff0c\u4e4b\u524d\u5927\u9ea6\u7f51\u8bf4\u88ab 80W \u5e76\u53d1\u91cf\u6324\u7206\u4e86", "id": "t/400512", "date_published": "2017-10-25T02:56:57+00:00", "content_html": "

\u90a3\u4e48\uff0c80 \u4e07\u5e76\u53d1\u91cf\u662f\u4ec0\u4e48\u6982\u5ff5\u3002\n\u672c\u4eba java \u840c\u65b0\uff0c\u60f3\u6b7b\u4e2a\u660e\u767d\u3002

\n" }, { "author": { "url": "member/cxbig", "name": "cxbig", "avatar": "https://cdn.v2ex.com/avatar/5d08/eaa4/23163_large.png?m=1441656972" }, "url": "t/397428", "title": "Ansible \u8282\u70b9\u8fb9\u680f\u94fe\u63a5\u9519\u8bef", "id": "t/397428", "date_published": "2017-10-13T10:18:08+00:00", "content_html": "@Livid \r
\r
Ansible \u8282\u70b9\u8fb9\u680f\u7684\u201c Ansible Documentation \u201d\u7591\u4f3c\u6307\u5411\u9519\u8bef\u94fe\u63a5\uff1a\r
http://www.ansibleworks.com/ \u8fd9\u662f\u4e00\u4e2a\u65e5\u6587\u7f51\u7ad9\uff0c\u4e14\u5185\u5bb9\u4e0e\u6280\u672f\u4e0d\u6cbe\u8fb9\u3002\r
\r
Ansible \u6587\u6863\u5e94\u8be5\u662f\uff1a\r
http://docs.ansible.com/" }, { "author": { "url": "member/hagezhou", "name": "hagezhou", "avatar": "https://cdn.v2ex.com/avatar/c84e/35a6/63252_large.png?m=1500280726" }, "url": "t/397413", "title": "ansible \u4e2d\u7684 check \u6a21\u5f0f\u548c diff \u6a21\u5f0f\u5230\u5e95\u795e\u9a6c\u610f\u601d\uff1f", "id": "t/397413", "date_published": "2017-10-13T09:26:47+00:00", "content_html": "

\u6700\u65b0\u5728\u4f7f\u7528 ansible\uff0c\u4e5f\u770b\u4e86\u4e0b ansible \u7684 python api\uff0c\u53d1\u73b0\u91cc\u9762\u6709\u4e2a check \u548c diff \u6a21\u5f0f

\n

\u4ece\u5b98\u65b9\u6587\u6863\u7684\u89e3\u91ca\u662f\u8fd9\u6837\n\u201c\u5f53\u4ee5 --check \u53c2\u6570\u6765\u8fd0\u884c ansible-playbook \u65f6,\u5c06\u4e0d\u4f1a\u5bf9\u8fdc\u7a0b\u7684\u7cfb\u7edf\u4f5c\u51fa\u4efb\u4f55\u66f4\u6539.\u201d\n\u4ece-h \u4e2d\u770b\u5230\n\u201c -C, --check don't make any changes; instead, try to predict some\nof the changes that may occur\n-D, --diff when changing (small) files and templates, show the\ndifferences in those files; works great with --check \u201d

\n

\u4f46\u5176\u5b9e\u8fd8\u662f\u4e0d\u660e\u767d\uff0c\u5c24\u5176\u662f\u4f7f\u7528 command \u6216\u8005 shell \u6a21\u5757\u7684\u65f6\u5019\uff0c\u66f4\u662f\u4e00\u70b9\u533a\u522b\u4e5f\u611f\u89c9\u4e0d\u51fa\u6765\uff0c\u6c42\u5927\u795e\u89e3\u91ca\uff0c\u8c22\u8c22

\n" }, { "author": { "url": "member/wangmingbuhaoqi", "name": "wangmingbuhaoqi", "avatar": "https://cdn.v2ex.com/gravatar/f96d07762833a13ceac99df780e754d2?s=73&d=retro" }, "url": "t/392311", "date_modified": "2017-09-20T09:04:39+00:00", "content_html": "\n

-S, --su run operations with su (deprecated, use become)

\n

-R SU_USER, --su-user=SU_USER\nrun operations with su as this user (default=root)\n(deprecated, use become)

\n

\u4f46\u662f\u6211\u6267\u884c\u7684\u65f6\u5019\uff0c\u770b\u65e5\u5fd7\uff0c\u5e94\u8be5\u662f\u767b\u9646\u4e0a\u53bb\u4e86\uff0c\u518d\u5207\u6362\u7528\u6237\u7684\u65f6\u5019\u8c8c\u4f3c\u597d\u60f3\u4e0d\u884c\uff0c\u4e5f\u770b\u4e0d\u61c2\u662f\u5565\u610f\u601d\uff1f

\n

\u6709\u5927\u795e\u5e2e\u52a9\u770b\u4e0b\u6ca1\uff1f

\n", "date_published": "2017-09-20T08:59:33+00:00", "title": "ansible su \u5207\u6362\u7528\u6237\u95ee\u9898\uff1f", "id": "t/392311" }, { "author": { "url": "member/Atang", "name": "Atang", "avatar": "https://cdn.v2ex.com/gravatar/40359cbcc6493098eb1398d6696f0258?s=73&d=retro" }, "url": "t/360940", "title": "\u8bf7\u5047 ansible \u91cc template \u6a21\u677f\u662f\u5426\u652f\u6301\u76ee\u5f55\u5462", "id": "t/360940", "date_published": "2017-05-12T10:41:31+00:00", "content_html": "

\u6211\u60f3\u628a\u4e00\u4e2a\u76ee\u5f55\u91cc\u9762\u7684\u914d\u7f6e\u6587\u4ef6\u90fd\u5199\u6210\u6a21\u677f\uff0c\u7136\u540e\u901a\u8fc7 ansible template model \u628a\u6a21\u677f\u914d\u7f6e\u5206\u53d1\u5230\u76ee\u7684\u4e3b\u673a\u7684\u76ee\u5f55\u4e0a\uff0c\u6709\u6ca1\u6709\u4ec0\u4e48\u597d\u7684\u65b9\u6cd5\u5462\uff1f\uff1f\neg\uff1a\n\u251c\u2500\u2500 a\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 a.conf\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 b.conf\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 c.conf\n\u251c\u2500\u2500 d.conf\n\u251c\u2500\u2500 e.conf\n\u251c\u2500\u2500 f.conf\n\u251c\u2500\u2500 c\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 d.conf\n\u251c\u2500\u2500 g\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 bj.conf\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 cr.conf\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 v.conf\n\u2514\u2500\u2500 z.conf

\n" }, { "author": { "url": "member/yuyuyu", "name": "yuyuyu", "avatar": "https://cdn.v2ex.com/gravatar/404e1553e124f81702df464304819b95?s=73&d=retro" }, "url": "t/359619", "title": "ansible \u5982\u4f55\u63a7\u5236 windows \u540e\u53f0\u8fd0\u884c nginx\uff1f", "id": "t/359619", "date_published": "2017-05-06T14:48:26+00:00", "content_html": "

\u6211\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u542f\u52a8

\n
ansible web -m win_shell -a 'start nginx chdir=C:\\\\nginx-1.13.0'\n
\n

\u7ed3\u679c\u547d\u4ee4\u6267\u884c\u5b8c\u8fd4\u56de\u540e\uff0cwindows \u4e0a\u6ca1\u6709 nginx \u7684\u8fdb\u7a0b\uff0c\u4f46 nginx \u6709\u751f\u6210 logs\uff0c\u611f\u89c9\u662f\u521a\u542f\u52a8\u5b8c\u968f\u7740 ansible \u7684\u8fd4\u56de\u53c8\u88ab\u6740\u6389\u4e86\n\u6211\u770b\u4e86 ansible \u5b98\u65b9\u6587\u6863 http://docs.ansible.com/ansible/win_shell_module.html \u4e0b\u9762\u6709\u8bf4\u201c WinRM will not return from a command execution until all child processes created have exited. Thus, it is not possible to use win_shell to spawn long-running child or background processes. Consider creating a Windows service for managing background processes.\u201d\n\u4f46\u6211\u786e\u5b9e\u8981\u542f\u52a8 nginx \u5e76\u4e14\u4e0d\u5e0c\u671b\u7528\u670d\u52a1\u7684\u65b9\u5f0f\uff0c\u4e0d\u7136\u6ca1\u529e\u6cd5 -s reload

\n

\u4e5f\u5c1d\u8bd5\u8fc7\u8fd0\u884c\u4e00\u4e2a cmd \u7136\u540e\u91cc\u9762\u5199 start nginx\uff0c\u8fd8\u6709\u81ea\u5df1\u5199\u4e00\u4e2a\u5c0f\u7a0b\u5e8f\u53bb\u8fd0\u884c nginx\uff0c\u90fd\u4e0d\u884c\uff0c\u8981\u4e48\u662f\u6ca1\u6709 nginx \u8fdb\u7a0b\uff0c\u8981\u4e48\u662f nginx \u542f\u52a8\u6210\u529f\u4f46 ansible \u4e00\u76f4\u6302\u8d77\u6ca1\u6709\u8fd4\u56de

\n" }, { "author": { "url": "member/dynaguy", "name": "dynaguy", "avatar": "https://cdn.v2ex.com/avatar/c4d9/7c26/111374_large.png?m=1460171914" }, "url": "t/347524", "date_modified": "2017-03-14T23:30:38+00:00", "content_html": "\u6709\u4e2a\u76ee\u5f55(\u5185\u6709\u6587\u4ef6\uff0c\u5b50\u76ee\u5f55\uff0c link)\u5728\u63a7\u5236\u673a\u4e0a\uff0c\u8981\u590d\u5236\u5230\u76ee\u6807\u673a\u4e0a\uff0c\u548b\u5c31\u8fa3\u4e48\u96be\u5462\uff1f\r
\r
Playbook:\r
- hosts: testvbox\r
become: true\r
tasks:\r
- name: Copy Paraview lib files\r
src: /etc/ansible/files/ParaView-5.3.0-Qt5-OpenGL2-MPI-Linux-64bit/lib/ \r
dest: /usr/local/lib/\r
archive: no\r
links: yes\r
\r
\u62a5\u9519\uff1a\r
TASK [Copy Paraview lib files] *************************************************\r
fatal: [192.168.123.165]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --links --rsh 'ssh -S none -o StrictHostKeyChecking=no' --rsync-path=\\"sudo rsync\\" --out-format='<<CHANGED>>%i %n%L' \\"/etc/ansible/files/ParaView-5.3.0-Qt5-OpenGL2-MPI-Linux-64bit/lib/\\" \\"sysadmin@192.168.123.165:/usr/local/lib/\\"", "failed": true, "msg": "sudo: no tty present and no askpass program specified\\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\\nrsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]\\n", "rc": 12}\r
\tto retry, use: --limit @/etc/ansible/test.retry\r
\r
\u8bd5\u4e86 copy \u6a21\u5757\u4e5f\u5931\u8d25\u4e86\uff01\r
\r
\u547c\u5524\u8001\u53f8\u673a\uff01", "date_published": "2017-03-14T23:27:24+00:00", "title": "\u73a9 Ansible \u8650\u5230\u81ea\u5df1\u4e86\uff01", "id": "t/347524" }, { "author": { "url": "member/Livid", "name": "Livid", "avatar": "https://cdn.v2ex.com/avatar/c4ca/4238/1_large.png?m=1776858751" }, "url": "t/346076", "title": "Ansible Container", "id": "t/346076", "date_published": "2017-03-09T03:19:30+00:00", "content_html": "https://www.ansible.com/ansible-container" }, { "author": { "url": "member/SharkIng", "name": "SharkIng", "avatar": "https://cdn.v2ex.com/gravatar/e8756e76f9cae6cbe531ab8701c0a534?s=73&d=retro" }, "url": "t/345183", "date_modified": "2017-03-06T00:59:33+00:00", "content_html": "

https://docs.ansible.com/ansible/intro_dynamic_inventory.html \u8fd9\u90e8\u5206\n\u597d\u50cf EC2 \u7684\u8bdd\u53ef\u4ee5\u901a\u8fc7 Tag \u6765\u5206\u522b\uff0c\u6709\u4e00\u4e2a ansible -i ec2.py tab_TagName_TagValue \u7684\u529e\u6cd5\u53ef\u4ee5\u6765\u6307\u5b9a

\n

\u90a3\u4e48 Linode \u548c DigitalOcean \u7b49\u670d\u52a1\u5546\u6709\u4ec0\u4e48\u529e\u6cd5\u6765\u533a\u5206\u4e48\uff1f\n\u540c\u65f6\u8fd9\u4e2a\u6709\u6ca1\u6709\u529e\u6cd5\u5199\u4e00\u4e2a file \u6765\uff1f\u4e5f\u5c31\u662f\u8bf4\u901a\u8fc7 Script \u6765\u83b7\u53d6\u6240\u6709\uff0c\u7136\u540e\u53e6\u4e00\u4e2a\u6587\u4ef6\u6765\u5206\u7c7b\u4e0d\u540c\u7528\u9014\u7684 Host \uff1f

\n", "date_published": "2017-03-05T22:34:53+00:00", "title": "Ansible \u4f7f\u7528 Dynamic inventory \u7684 Script \u5f97\u5230\u7684\u6240\u6709\u4e3b\u673a\u4fe1\u606f\u6709\u529e\u6cd5\u5206\u7c7b\u4e48\uff1f", "id": "t/345183" }, { "author": { "url": "member/dynaguy", "name": "dynaguy", "avatar": "https://cdn.v2ex.com/avatar/c4d9/7c26/111374_large.png?m=1460171914" }, "url": "t/344494", "title": "Ansible \u521d\u5b66\u95ee\u9898", "id": "t/344494", "date_published": "2017-03-02T18:58:41+00:00", "content_html": "\u60f3\u5b66 Ansible.\u3000\u6709\u4e2a\u5177\u4f53\u95ee\u9898\u8bf7\u6559\u8001\u53f8\u673a\uff1a\r
\r
\u6709\u4e00\u4e2a Ubuntu 16.04 Desktop \uff08\uff21\uff09,\u3000 PXE preseed \u5b89\u88c5\u7684\u3002\u5b89\u88c5\u597d\u540e\u7684\u72b6\u6001\u662f\uff1a\r
\uff11\uff0e\u3000 openssh-server \u5df2\u88c5\u5e76\u8fd0\u884c\uff1b\r
\uff12\uff0e\u3000\u6709\u4e00\u4e2a sudoer \u7528\u6237\u201c admin \u201d, \u5bc6\u7801\u9884\u8bbe\u597d\u4e86\u3002\u767b\u5f55\u540e\u53ef\u4ee5 sudo\r
\uff13\uff0e\u3000 SSH server \u9ed8\u8ba4\u4e0d\u5bb9\u8bb8 root \u76f4\u63a5\u767b\u5f55\r
\r
\u73b0\u5728\u6211\u60f3\u7528 ansible \u5bf9\u8fd9\u53f0\u673a\u5668\u90e8\u7f72\u4e00\u4e9b\u5e94\u7528\u7a0b\u5e8f\uff0c\u9996\u5148\u8981\u8ba9 ansible \u80fd\u7528 root \u81ea\u52a8\u767b\u5f55 ssh \uff0c\u6216\u7528 admin \u767b\u5f55\u7136\u540e sudo (\u7406\u89e3\u7684\u5bf9\u5417\uff1f\uff09\u8fd9\u8981\u6211\u624b\u52a8\u5148\u505a\u628a puclic key \u5f04\u597d\uff08\u4f20\u5230 A \u4e0a\uff09\u3002\u628a\u8fd9\u4e24\u4e2a\u641e\u5b9a\u624d\u53ef\u4ee5\u7ee7\u7eed ansible... \r
\r
\u61d2\u4eba\u95ee\u9898\u6765\u4e86\uff1a\u8fd9\u6b65\u80fd\u81ea\u52a8\u5b9e\u73b0\u5417\uff1f\u4e00\u53f0\u673a\u5668\u6211\u5fcd\u4e86\uff0c\u592a\u591a\u4e86\u5c31\u70e6\u4e86\u3002" }, { "author": { "url": "member/fx", "name": "fx", "avatar": "https://cdn.v2ex.com/avatar/44c2/821d/32939_large.png?m=1758687863" }, "url": "t/256303", "title": "ansible \u600e\u4e48\u5173\u95ed ask sudo password?", "id": "t/256303", "date_published": "2016-02-13T09:43:37+00:00", "content_html": "

\"\"

\n\n

\u5df2\u7ecf\u914d\u7f6e\u4e86 host \u4e3a ansible_ssh_user=root

\n\n

\u4f7f\u7528 root \u8d26\u53f7\uff0c\u4e3a\u4ec0\u4e48\u8fd8\u8981\u95ee sudo \u5bc6\u7801\uff1f

\n" }, { "author": { "url": "member/jianyunet", "name": "jianyunet", "avatar": "https://cdn.v2ex.com/avatar/db1c/b87e/133534_large.png?m=1633180275" }, "url": "t/244825", "title": "\u53d1\u4e2a\u798f\u5229\u7ed9 Ansible \u7684\u540c\u5b66\u4eec\uff0c\u672c\u4eba\u4eb2\u6d4b\u6709\u6548", "id": "t/244825", "date_published": "2015-12-20T07:12:06+00:00", "content_html": "Hey <...>\r
\r
I work for G2 Crowd, a user review site for business software. I noticed on GitHub that you have used Ansible in the past.\r
\r
Ansible is underrepresented in G2 Crowd's Build Automation category, and I was wondering if you would review it within a week or so, as I need to collect review data for an upcoming report on the category. Alternatively, if you don't use it, it would be really helpful to know so I can continue searching for users.\r
\r
Link to write a review: https://www.g2crowd.com/contributor/github-offplay-ansible?rewards=true\r
\r
When your review is verified, will send you a $15 Amazon gift card code via email, and anyone with the link qualifies so feel free to forward it if you'd like.\r
\r
Additionally, we are also looking for reviews of GitHub, and are offering a $5 gift card for these reviews - https://www.g2crowd.com/contributor/Github-Odesk-Github?rewards=true\r
\r
Thanks so much for the help!\r
-Levi Olmstead\r
-G2 Crowd" }, { "author": { "url": "member/QQ1685425675", "name": "QQ1685425675", "avatar": "https://cdn.v2ex.com/gravatar/9141f3afc3078329efaacf7a15c425a4?s=73&d=retro" }, "url": "t/237072", "date_modified": "2015-11-18T07:30:03+00:00", "content_html": "

\u670d\u52a1\u5668 linux
\n\u6211\u7684\u7535\u8111 win10
\npython 3.4

\n\n

\u6211\u5e73\u65f6\u5728 win10 \u5f00\u53d1\u5b8c\u6210\uff0c\u7136\u540e\u60f3\u5728 win10 \u4e0a\u7528 ansible \u63a7\u5236\u8fdc\u7a0b linux
\n\u4f46\u662f\u5b9e\u9645\u64cd\u4f5c\u4e2d \u603b\u662f\u51fa\u73b0\u5404\u79cd\u95ee\u9898

\n\n

\u7f51\u4e0a\u770b\u5230\u6709\u4eba\u8bf4 \uff0c\u8fd9\u4e2a\u4e1c\u897f\u73b0\u5728\u4e0d\u652f\u6301 win \u4f5c\u4e3a\u63a7\u5236\u7aef

\n\n

\u662f\u8fd9\u6837\u7684\u5417

\n\n

\u6709\u529e\u6cd5\u89e3\u51b3\u5417

\n", "date_published": "2015-11-18T07:26:01+00:00", "title": "ansible \u4e0d\u652f\u6301 windows \u505a\u63a7\u5236\u7aef\u5417\uff1f\u6211\u7684 windows10 py3.4 \u7528\u8fd9\u4e2a\u8001\u662f\u51fa\u9519", "id": "t/237072" }, { "author": { "url": "member/pyKun", "name": "pyKun", "avatar": "https://cdn.v2ex.com/avatar/5580/d031/23741_large.png?m=1356574533" }, "url": "t/194853", "title": "ansible \u6709\u4ec0\u4e48\u4f18\u70b9\u4e48\uff1f", "id": "t/194853", "date_published": "2015-05-30T02:22:37+00:00", "content_html": "\u6700\u8fd1\u53c2\u4e0e\u7684\u51e0\u4e2a\u9879\u76ee\u90fd\u7528\u5230\u4e86ansible\uff0c\u4e0d\u8fc7\u7528\u8d77\u6765\u6ca1\u6709\u592a\u591a\u611f\u89c9...\u4f46\u770b\u5230\u8fd9\u4e2a\u6700\u8fd1\u6709\u633a\u706b\uff0c\u6c42\u6559\u80b2...\r
\r
\u6bd4\u8f83\u660e\u663e\u7684\u4f18\u70b9\uff1a\r
1. \u8f7b\u91cf\u7ea7\u4e00\u70b9\uff08\u7406\u89e3ssh\u5c31\u597d\uff09\r
2. \u8bed\u6cd5\u597d\u61c2\uff08\u786e\u5b9e\u6bd4puppet\u597d\u61c2\u592a\u591a\u4e86\uff09\r
\r
\u5176\u4ed6\u7684\uff0c\u6027\u80fd\u4e0a\u6216\u8005\u793e\u533a\u4e0a\u8fd8\u6709\u4ec0\u4e48\u4f18\u52bf\u4e48\uff1f" }, { "author": { "url": "member/tftk", "name": "tftk", "avatar": "https://cdn.v2ex.com/avatar/a05e/a8dc/64056_large.png?m=1642224656" }, "url": "t/166262", "title": "Ansible \u5b98\u7f51\u7684\u6587\u6863\u8bfb\u8d77\u6765\u597d\u522b\u626d", "id": "t/166262", "date_published": "2015-01-28T10:00:53+00:00", "content_html": "\u662f\u56e0\u4e3a\u6211\u82f1\u6587\u592a\u70c2\u4e48\uff1f" }, { "author": { "url": "member/lex", "name": "lex", "avatar": "https://cdn.v2ex.com/avatar/db2b/4182/1097_large.png?m=1756000193" }, "url": "t/164560", "title": "Ansible \u8282\u70b9\u8fd9\u4e48\u51b7\u6e05? \u6ca1\u6709\u4eba\u7528\u5417?", "id": "t/164560", "date_published": "2015-01-22T09:42:26+00:00", "content_html": "\u6211\u81ea\u5df1\u7528 Ansible \u534a\u5e74\u591a\uff0c\u7ba1\u7406\u5927\u5c0f\u865a\u62df\u673a 10 ~ 30 \u53f0\uff0c\u611f\u89c9\u5404\u79cd\u670d\u52a1\u5668\u914d\u7f6e\u7684\u4f53\u529b\u6d3b\u7528 Ansible \u641e\u633b\u65b9\u4fbf\u7684\uff0c\u4e3b\u8981\u662f\u56e2\u961f\u5176\u4ed6\u4eba\u4e5f\u80fd\u5f88\u5feb\u4e0a\u624b\u3002\u76f8\u6bd4 Chef \u548c Puppet\uff0c\u5b83\u7684\u914d\u7f6e\u66f4\u7b80\u5355\u6613\u61c2\uff1b\u548c SaltStack \u6bd4, Ansible \u53bb\u4e2d\u5fc3\u5316\u7684\u6a21\u5f0f\u5f88\u9002\u5408\u505a\u5c0f\u5200\u5feb\u5207\u7684\u4e8b\u3002\u6211\u81ea\u5df1\u662f\u505a iOS \u5f00\u53d1\u7684\uff0c\u7ef4\u62a4\u4e86\u4e00\u5957\u5e38\u7528\u5de5\u5177\u7684 playbook\uff0c\u8282\u7701\u4e86\u5927\u91cf\u641e\u670d\u52a1\u5668\u7684\u65f6\u95f4:
https://github.com/lexrus/ios-dev-playbook
\u4f46\u662f\u6211\u603b\u6709\u4e00\u79cd\u9884\u611f\uff0c\u8981\u662f\u67b6\u6784\u4e0a\u89c4\u6a21\u4e86\uff0c\u901a\u8fc7 ssh \u8fd9\u4e48\u641e\u4e0d\u9760\u8c31\uff0c\u80af\u5b9a\u4f1a\u51fa\u4e8b\u3002\u5230\u65f6\u5019\u662f\u4e0a Ansible Tower \u5462\uff0c\u8fd8\u662f\u8f6c\u6218 Chef / Puppet\uff1f
\u4e0d\u77e5\u9053\u5927\u5bb6\u6709\u6ca1\u6709\u5728\u7528 Ansible \u7684\uff1f" }, { "author": { "url": "member/lex", "name": "lex", "avatar": "https://cdn.v2ex.com/avatar/db2b/4182/1097_large.png?m=1756000193" }, "url": "t/160678", "date_modified": "2015-01-22T09:18:43+00:00", "content_html": "

https://github.com/lexrus/do-ikev1

\n\n

\"Install

\n", "date_published": "2015-01-09T08:46:58+00:00", "title": "\u7528 DigitalOcean \u4e00\u952e\u90e8\u7f72 Cisco IPSec", "id": "t/160678" }, { "author": { "url": "member/tin", "name": "tin", "avatar": "https://cdn.v2ex.com/gravatar/e9a7ed672c1c17593d968f69dcd89746?s=73&d=retro" }, "url": "t/124628", "date_modified": "2014-07-26T10:40:06+00:00", "content_html": "\u5728\u7f51\u4e0a\u627e\u4e86\u5f88\u4e45\uff0c\u6ca1\u6709\u4e2d\u6587\u6559\u7a0b\u3002\u8bf7\u95ee\u8fd9\u4e2a\u6709\u4e2d\u6587\u6559\u7a0b\u4e0d\uff1f\u82f1\u6587\u770b\u7740\u592a\u8d39\u52b2\u4e86\u3002\u3002\u3002\u8c22\u8c22", "date_published": "2014-07-26T10:26:55+00:00", "title": "\u6709\u4e86\u89e3 ansible-playbook \u7684\u4e48", "id": "t/124628" } ] } ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86