当前位置:网站首页>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
边栏推荐
- 杰理之系统事件有哪些【篇】
- F-niu Mei's apple tree (diameter combined)
- PHP two-dimensional array specifies that the elements are added after they are equal, otherwise new
- Integral function and Dirichlet convolution
- NEC红外遥控编码说明
- Flutter's loading animation is more interesting
- SAP salv14 background output salv data can directly save files and send emails (with sorting, hyperlink and filtering format)
- Introduction to graph theory -- drawing
- ES-aggregation聚合分析
- Mobius inversion
猜你喜欢

深度选择器

SAP 03-amdp CDs table function using 'with' clause

構建元宇宙時代敏捷制造的九種能力

Educational Codeforces Round 81 (Rated for Div. 2)

Career planning and implementation in the era of meta universe

2022年流动式起重机司机考试题库模拟考试平台操作

Failureforwardurl and failureurl

SAP debug debug for in, reduce and other complex statements

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

从知识传播的维度对比分析元宇宙
随机推荐
第二章 Oracle Database In-Memory 体系结构(上) (IM-2.1)
Educational Codeforces Round 81 (Rated for Div. 2)
[hdu6868] absolute math (pusher + Mobius inversion)
Skill point digging
Go语言实践模式 - 函数选项模式(Functional Options Pattern)
[untitled]
SAP ECC connecting SAP pi system configuration
Custom login failure handling
Easy to understand subset DP
Construire neuf capacités de fabrication agile à l'ère métacosmique
A concise course of fast Fourier transform FFT
[COCI] lattice (dichotomy + tree divide and conquer + string hash)
Epidemic prevention registration applet
Planning and construction of industrial meta universe platform
PHP two-dimensional array specifies that the elements are added after they are equal, otherwise new
第三章 启用和调整IM列存储的大小(IM-3.1)
Sim Api User Guide(4)
Formattime timestamp format conversion
第一章 Oracle Database In-Memory 相关概念(续)(IM-1.2)
Redis 过期 key 清理删除策略汇总