当前位置:网站首页>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
边栏推荐
- SAP 03-amdp CDs table function using 'with' clause
- Planning and construction of industrial meta universe platform
- PHP notes (I): development environment configuration
- SAP pi / PO function operation status monitoring and inspection
- AI上推荐 之 MMOE(多任务yyds)
- Longest common front string
- formatTime时间戳格式转换
- 论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》
- Sim Api User Guide(4)
- [codeforces - 208e] blood cousins
猜你喜欢

C语言:表达式求值(整型提升、算术转换 ...)

2022年制冷与空调设备运行操作考试练习题及模拟考试

Sim Api User Guide(4)

Nine abilities of agile manufacturing in the era of meta universe

"Gu Yu series" airdrop

Comparative analysis of meta universe from the dimension of knowledge dissemination

2022茶艺师(初级)考试试题模拟考试平台操作

0704、ansible----01
![[untitled]](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[untitled]

Custom login failure handling
随机推荐
[COCI] Vje š TICA (subset DP)
Introduction to sap pi / PO login and basic functions
杰理之AES能256bit吗【篇】
SAP ECC connecting SAP pi system configuration
第三章 启用和调整IM列存储的大小(IM-3.1)
2022年上海市安全员C证考试题库及答案
DBA常用SQL语句(4)- Top SQL
杰理之栈溢出 stackoverflow 怎么办?【篇】
Explanation of order and primitive root of number theory
Amazon cloud technology entry Resource Center, easy access to the cloud from 0 to 1
Compile and debug mysql8 with clion under MacOS x
Example of data object mask used by SAP translate
通过流式数据集成实现数据价值(3)- 实时持续数据收集
Pyqt5与通信
Career planning and implementation in the era of meta universe
Pyqt5 and communication
SAP pi / PO soap2proxy consumption external WS example
2022年流动式起重机司机考试题库模拟考试平台操作
杰理之有时候发现内存被篡改,但是没有造成异常,应该如何查找?【篇】
Golang force buckle leetcode 396 Rotation function