当前位置:网站首页>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
边栏推荐
- Code source daily question div1 (701-707)
- [ACM-ICPC 2018 Shenyang Network preliminaries] J. Ka Chang (block + DFS sequence)
- 杰理之栈溢出 stackoverflow 怎么办?【篇】
- C语言:表达式求值(整型提升、算术转换 ...)
- 第三章 启用和调整IM列存储的大小(IM-3.1)
- 论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》
- MapReduce计算流程详解
- Nvidia最新三维重建技术Instant-ngp初探
- 杰理之更准确地确定异常地址【篇】
- Dropout技术之随机神经元与随机深度
猜你喜欢
ABAP publishes OData service samples from CDs view
How to use SQL statement union to get another column of another table when the content of a column in a table is empty
ABAP CDs view with association example
0704、ansible----01
SAP excel has completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
構建元宇宙時代敏捷制造的九種能力
Leetcode0587. Install fence
2022年流动式起重机司机考试题库模拟考试平台操作
工业元宇宙平台规划与建设
SAP CR transmission request sequence and dependency check
随机推荐
第三章 启用和调整IM列存储的大小(IM-3.1)
ARM调试(1):两种在keil中实现printf重定向到串口的方法
[hdu6868] absolute math (pusher + Mobius inversion)
Planning and construction of industrial meta universe platform
構建元宇宙時代敏捷制造的九種能力
杰理之更准确地确定异常地址【篇】
Function realization of printing page
How to use SQL statement union to get another column of another table when the content of a column in a table is empty
DBA常用SQL语句 (5) - Latch 相关
Setnx command execution failed due to full redis memory
DBA常用SQL语句(2)— SGA和PGA
Go language practice mode - functional options pattern
杰理之通常程序异常情况有哪些?【篇】
Leetcode question bank 78 Subset (recursive C implementation)
通过流式数据集成实现数据价值(2)
ES-aggregation聚合分析
Integral function and Dirichlet convolution
P1390 sum of common divisor (Mobius inversion)
Flutter's loading animation is more interesting
[COCI] Vje š TICA (subset DP)