当前位置:网站首页>ansible 云计算 自动化 命令行精简版
ansible 云计算 自动化 命令行精简版
2022-04-23 09:56:00 【数据库从删库到跑路】
1) 安装
2) 查看版本
3) 配置文件
4) 查看帮助 # 必会
5) 简单命令行 # -m shell -a '命令'
常用四大模块:
yum copy file service
几个重要概念:
安装present
卸载absent
升级latest
排除exclude
指定仓库enablerepo
语法格式:
ansible 主机名或组名 -m 指定模块 -a 具体命令
yum模块:
示例1: 安装当前最新的apache软件, 如果存在则更新
示例2: 安装当前最新的apache软件, 通过本地仓库安装
示例3: 删除apache软件
copy模块:
示例1: 将本地的httpd.conf文件Listen端口修改为8080, 然后推送到远端服务器 组 权限
示例2: 将本地的httpd.conf文件Listen端口修改为8088, 然后推送到远端, 检查远端是否存在上一次的备份文件
示例3: 往远程的主机文件中写入内容: content dest
file模块:
示例1: 创建文件/var/www/html/demo.html, 并设定属主 属组 权限
示例2: 创建目录/var/www/html/imgs, 并设定属主 属组 权限 state=directory
示例3: 递归授权目录的方式 recurse=yes path
service模块:
ansible group1 -m service -a "name=httpd state=stopped enabled=yes"
任务名字:
目标主机:
几个任务:
单个任务: 详细需求 (需要哪几个模块的支撑) (LAMP)
版权声明
本文为[数据库从删库到跑路]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_60655253/article/details/124274689
边栏推荐
- Epidemic prevention registration applet
- Setnx command execution failed due to full redis memory
- 第一章 Oracle Database In-Memory 相关概念(IM-1.1)
- 《谷雨系列》空投
- Sim Api User Guide(8)
- Pyqt5 and communication
- 理解作用域
- SAP excel has completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
- How to obtain geographical location based on photos and how to prevent photos from leaking geographical location
- MapReduce计算流程详解
猜你喜欢

工业元宇宙平台规划与建设

SAP RFC_ CVI_ EI_ INBOUND_ Main BP master data creation example (Demo customer only)

How to use SQL statement union to get another column of another table when the content of a column in a table is empty

Solving Lucas number and combination theorem

The central control learning infrared remote control module supports network and serial port control

SAP salv14 background output salv data can directly save files and send emails (with sorting, hyperlink and filtering format)

Planning and construction of industrial meta universe platform

Amazon cloud technology entry Resource Center, easy access to the cloud from 0 to 1

Custom login failure handling

中控学习型红外遥控模块支持网络和串口控制
随机推荐
第一章 Oracle Database In-Memory 相关概念(续)(IM-1.2)
How to use SQL statement union to get another column of another table when the content of a column in a table is empty
Go语言实践模式 - 函数选项模式(Functional Options Pattern)
Prefix sum of integral function -- Du Jiao sieve
DBA常用SQL语句(6)- 日常管理
Alibaba cloud architects interpret the four mainstream game architectures
云身份过于宽松,为攻击者打开了大门
Random neurons and random depth of dropout Technology
PHP notes (I): development environment configuration
Computer network security experiment II DNS protocol vulnerability utilization experiment
通过流式数据集成实现数据价值(1)
SAP salv14 background output salv data can directly save files and send emails (with sorting, hyperlink and filtering format)
Pyqt5 and communication
[educational codeforces round 80] problem solving Report
通过流式数据集成实现数据价值(5)- 流处理
防疫登记小程序
[hdu6868] absolute math (pusher + Mobius inversion)
Cloud identity is too loose, opening the door for attackers
面试官:说几个PHP常用函数,幸好我面试之前看到了这篇文章
NEC红外遥控编码说明