惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
Vulnerabilities – Threatpost
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Privacy International News Feed
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
MyScale Blog
MyScale Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
L
LINUX DO - 最新话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Cloudflare Blog
美团技术团队
Recorded Future
Recorded Future
T
Tailwind CSS Blog
Latest news
Latest news
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
Cloudbric
Cloudbric
Schneier on Security
Schneier on Security
I
Intezer
L
LINUX DO - 热门话题
P
Palo Alto Networks Blog
云风的 BLOG
云风的 BLOG
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
L
LangChain Blog
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
L
Lohrmann on Cybersecurity
S
SegmentFault 最新的问题
W
WeLiveSecurity
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
SecWiki News
SecWiki News
V2EX - 技术
V2EX - 技术
IT之家
IT之家
Cyberwarzone
Cyberwarzone
F
Full Disclosure
Spread Privacy
Spread Privacy
阮一峰的网络日志
阮一峰的网络日志

标签 on 打工人日志

日报 k8s Guide Self-Hosted Automation CLI error linux nginx pve daliy 运维 docker stable diffusion github 测试 gitlab 日常生活 IOS 开发 midjourney ChatGPT skywalking work 周报 基础 oracle brew logstash IPFS web3.0 nps 内网穿透 美食 golang RocketMQ Planet mysql prometheus java javascript 外快 网心云 扩容磁盘 自动化 minIO k3s Terraform rsync DockerCompose dockerfile 树莓派 Markdown 打赏 TCP/IP
ansible
2022-04-14 · via 标签 on 打工人日志

ansible 命令 Inventory:Ansible 管理的主机信息,包括 IP 地址、SSH 端口、账号、密码等 Modules:任务均有模块完成,也可以自定义模块,例如经常用的脚本。 Plugins:使用插件增加 Ansible 核心功能,自身提供了很多插件,也可以自定义插件。例如 connection 插件,用于连接目标主机。 Playbooks:“剧本”,模块化定义一系列任务,供外部统一调用。Ansible 核心功能。 编辑主机清单 1[webservers] 2192.168.0.20 ansible_ssh_user=root ansible_ssh_pass=’200271200’ 3192.168.0.21 ansible_ssh_user=root ansible_ssh_pass=’200271200’ 4192.168.0.22 ansible_ssh_user=root ansible_ssh_pass=’200271200’ 5 6[dbservers] 710.12.0.100 810.12.0.101 1sed -i "s/#host_key_checking = .*/host_key_checking = False/g" /etc/ansible/ansible.cfg 命令行 1ansible all -m ping 2ansible all -m shell -a "ls /root" -u root -k 常用模块 在目标主机执行 shell 命令。 shell 1- name: 将命令结果输出到指定文件 2 shell: somescript.sh >> somelog.txt 3- name: 切换目录执行命令 4 shell: 5 cmd: ls -l | grep log 6 chdir: somedir/ 7- name: 编写脚本 8 shell: | 9 if [ 0 -eq 0 ]; then 10 echo yes > /tmp/result 11 else 12 echo no > /tmp/result 13 fi 14 args: 15 executable: /bin/bash copy 将文件复制到远程主机。 1- name: 拷贝文件 2 copy: 3 src: /srv/myfiles/foo.