当前位置:网站首页>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
边栏推荐
- Depth selector
- A concise course of fast Fourier transform FFT
- Computer network security experiment II DNS protocol vulnerability utilization experiment
- Formattime timestamp format conversion
- PHP two-dimensional array specifies that the elements are added after they are equal, otherwise new
- 理解作用域
- 杰理之AES能256bit吗【篇】
- 论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——3背景
- SAP ECC connecting SAP pi system configuration
- Go language practice mode - functional options pattern
猜你喜欢

ARM调试(1):两种在keil中实现printf重定向到串口的方法
![[untitled]](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[untitled]

面试官:说几个PHP常用函数,幸好我面试之前看到了这篇文章

Chinese Remainder Theorem and extended Chinese remainder theorem that can be understood by Aunt Baojie

ABAP implementation publishes restful services for external invocation example

Educational Codeforces Round 81 (Rated for Div. 2)

Number theory blocking (integer division blocking)

《Redis设计与实现》

Practice of Flink streaming batch integration in Xiaomi

NEC infrared remote control coding description
随机推荐
"Gu Yu series" airdrop
Longest common front string
php 二维数组指定元素相等后相加否则新增
Sim Api User Guide(8)
GCD of p2257 YY (Mobius inversion)
Redis 过期 key 清理删除策略汇总
通过流式数据集成实现数据价值(5)- 流处理
解决VMware卸载后再安装出现的问题
云身份过于宽松,为攻击者打开了大门
P1446 [hnoi2008] cards (Burnside theorem + DP count)
Introduction to graph theory -- drawing
2022茶艺师(初级)考试试题模拟考试平台操作
Formattime timestamp format conversion
SAP debug debug for in, reduce and other complex statements
Sim Api User Guide(4)
杰理之有时候发现内存被篡改,但是没有造成异常,应该如何查找?【篇】
Number theory blocking (integer division blocking)
2022年广东省安全员A证第三批(主要负责人)考试试题及答案
面试官:说几个PHP常用函数,幸好我面试之前看到了这篇文章
ARM调试(1):两种在keil中实现printf重定向到串口的方法