当前位置: 首页 > news >正文

网站关键词写在哪里深圳关键词优化报价

网站关键词写在哪里,深圳关键词优化报价,西安搬家公司电话大全,国有企业投资建设项目ansible内置了很多模块,常用的并不多,可以通过ansible -l命令列出所有模块,使用 ansible-doc module-name 查看指定模块的帮助文档,例如:ansible-doc command ping模块 主要作用 判断远程客户端是否在线。没有参数 …

ansible内置了很多模块,常用的并不多,可以通过ansible -l命令列出所有模块,使用 ansible-doc module-name 查看指定模块的帮助文档,例如:ansible-doc command

ping模块

主要作用

判断远程客户端是否在线。没有参数

示例

ansible all -m ping

command模块

主要作用

执行Linux基础命令

使用详解

  • chdir:执行命令前,则不执行该步骤
  • creates:当该文件存在时,则不执行该步骤
  • executable:换用shell环境执行命令
  • free_form:需要执行的脚本
  • removes:当该文加不存在时,则不执行该步骤
  • warn:若在Ansible.cfg中存在告警。如果false,则不会警告此行。
  • 可以使用-a加要执行的命令直接执行,不过命令中如果带特殊字符,执行则会失败。

示例

ansible -k -i /etc/ansible/hosts all -m command -a "date"
ansible -k all -m command -a "ping -c www.baidu.com"
ansible zxserver -a "whoami"
ansible zxserver -a "chdir=/tmp/ ls"
ansible zxserver -a "creates=/tmp/testansible.txt date"

copy模块

主要作用

文件或目录复制

参数选项

  • src:本地源文件或目录的路径,空文件夹不复制
  • content:可替代src,用于将指定文件的内容复制到远程文件内
  • dest:客户端目标目录或者文件,需要绝对路径
  • backup:复制之前,先备份远程节点上的原始文件。backup=yes可以在覆盖之前对文件自动备份
  • directory_mode:用于复制文件夹,新建的文件会被复制,而老旧的不会被复制
  • follow:支持link文件复制
  • force:覆盖远程主机不一致的内容
  • group:设定远程主机文件夹的组名
  • mode:指定远程主机文件及文件夹的权限
  • owner:设定远程主机文件夹的用户名

示例

ansible -k all -m copy -a 'src=/etc/passwd dest=/tmp/ mode=755 owner=root'
ansible -k all -m copy -a 'content="Hello World" dest=/tmp/test.txt mode=755 owner=root'
ansible zxserver -m copy -a "src=/etc/odbc.ini dest=/etc/odbc.ini backup=yes"

YUM模块

主要作用

软件的安装、升级、卸载

使用详解

  • name:需要安装的软件名,支持软件组安装
  • update_cache:安装前更新缓存
  • state:软件包状态,是否安装或卸载
    • installed: 安装
    • removed: 卸载

示例

ansible all -m yum -a "name=screen state=installed"

file模块

主要作用

用于对文件的创建、删除、修改、权限、属性的维护和管理

参数选项

  • path:必选项,定义文件/目录的路径
  • state
  • directory:表示目录,如果目录不存在则创建目录
  • link:创建软链接
  • hard:创建硬链接
  • touch:如果文件不存在则创建,如果存在则更新修改时间。
  • absent:删除目录、文件或者取消链接文件
  • mode:定义文件权限
  • owner:定义属主
  • group:定义属组
  • recurse:递归设置文件属性,只对目录有效
  • src:被链接的源文件路径,只应用于state=link的情况
  • dest:要链接到的目标路径,只应用于state=link的情况

示例

  • 示例1:创建一个不存在的目录并进行递归授权
ansible zxserver -m file -a "path=/tmp/abc123 state=directory"
ansible zxserver -m file -a "path=/tmp/abc123 owner=nobody group=nobody mode=0644 recurse=yes" 
ansible zxserver -m file -a "path=/tmp/abc1234 owner=sshd group=sshd mode=0644 state=directory"
  • 示例2:创建一个文件
ansible zxserver -m file -a "path=/tmp/zhangsan.txt mode=0644"
# 或者
ansible zxserver -m file -a "path=/tmp/zhangsan.txt state=touch"
  • 示例3:创建一个软链接
ansible zxserver -m file -a "src=/usr/local/freeswitch/bin/fs_bin dest=/usr/bin/fs_cli state=link"
  • 示例4:删除一个文件
ansible zxserver -m file -a "path=/tmp/zhangsan.txt state=absent"

user模块

主要作用

用户管理

示例

# 新增用户
ansible grp1 -m user -a "name=zhangsan password=lisi"
# 删除用户
ansible grp1 -m user -a "name=zhangsan state=absent"

cron模块

主要作用

管理定时任务

使用详解

  • dayhourminutemonthweekday
  • state
    • present:创建定时任务
    • absent:删除定时任务
  • job:要执行的任务,依赖于state=present
  • special_time:特殊的时间范围。参数:
  • reboot:重启时
  • annually:每年
  • monthly:每月
  • weekly:每周
  • daily:每天
  • hourly:每小时
  • user:指定用户身份

示例

  • 示例1:系统重启时执行/data/bootservice.sh脚本
ansible zxserver -m cron -a 'name="jobForReboot" special_time=reboot job="/data/bootservice.sh"'
  • 示例2:每周六的1:20分执行yum -y update操作
ansible zxserver -m cron -a 'name="yumUpdate" weekday="6" minute="20" hourly="1" user="root" job="yum -y update"'

synchronize模块

主要作用

同步目录、文件,基于rsync

使用详解

  • compress:开启压缩
  • archive:是否采用归档模式同步,保证源和目标文件属性一致
  • checksum:是否校验
  • dirs:以非递归的方式传输目录
  • links:同步链接文件
  • recursive:是否递归yes/no
  • rsync_opts:使用rsync的参数
  • delete:删除源中没有而目标存在的文件
  • src:源目录及文件
  • dest:目标目录及文件
  • set_remote_user:设置远程用户名
  • dest_port:目标接受的端口
  • mode:同步的模式。默认为push,还有pull选项
  • --exclude=.log:忽略同步.log结尾的文件

示例

foo

shell模块

主要作用

远程客户端执行各种shell命令或者运行脚本。其用法和command模块一样,不过shell模块执行命令的时候使用的是/bin/sh,所以shell模块可以执行任何命令

示例

ansible zxserver -m shell -a "touch /tmp/testansible.txt;ls -l /tmp/testansible.txt"

service模块

主要作用

用于远程客户端各种服务管理,包括启动、停止、重启、重新加载

使用详解

  • enable:是否开机自启yes/no
  • name:必选项,服务名称
  • parttern:定义一个模式。如果status没有响应,则通过ps在进程中查找,匹配到就认为该服务依然在运行。
  • state:对服务执行启动、停止、重启、重加载等操作(started、stopped、restarted、reloaded)
  • sleep:如果指定了重启,则在stop和start之间沉睡几秒钟。

示例

ansible zxserver -m service -a "name=httpd state=started enable=yes"

get_url模块

主要作用

从web下载文件,类似wget

示例

  • 示例1:下载文件到远程主机的/tmp目录下。
ansible zxserver -m get_url -a "url=http://192.168.10.101/download/test.txt dest=/tmp"

文章转载自:
http://kata.xhqr.cn
http://comprehensibly.xhqr.cn
http://benzedrine.xhqr.cn
http://homograph.xhqr.cn
http://baconianism.xhqr.cn
http://pretender.xhqr.cn
http://hayrake.xhqr.cn
http://mab.xhqr.cn
http://voyeurist.xhqr.cn
http://revoltingly.xhqr.cn
http://picker.xhqr.cn
http://tesserae.xhqr.cn
http://confusable.xhqr.cn
http://stimulus.xhqr.cn
http://leftist.xhqr.cn
http://hoggerel.xhqr.cn
http://habitancy.xhqr.cn
http://hipline.xhqr.cn
http://trophozoite.xhqr.cn
http://chloroacetone.xhqr.cn
http://quinquangular.xhqr.cn
http://lieutenancy.xhqr.cn
http://hydromantic.xhqr.cn
http://unipole.xhqr.cn
http://midear.xhqr.cn
http://unanimity.xhqr.cn
http://bandsaw.xhqr.cn
http://adjunct.xhqr.cn
http://corvee.xhqr.cn
http://acetic.xhqr.cn
http://kuskokwim.xhqr.cn
http://divvers.xhqr.cn
http://tureen.xhqr.cn
http://impeachment.xhqr.cn
http://globulin.xhqr.cn
http://mongolian.xhqr.cn
http://ditchdigging.xhqr.cn
http://pommern.xhqr.cn
http://glowing.xhqr.cn
http://arithmetize.xhqr.cn
http://melchisedech.xhqr.cn
http://angled.xhqr.cn
http://postexilic.xhqr.cn
http://gegenschein.xhqr.cn
http://scienter.xhqr.cn
http://adenoma.xhqr.cn
http://offhand.xhqr.cn
http://brawly.xhqr.cn
http://isochar.xhqr.cn
http://inhere.xhqr.cn
http://engulf.xhqr.cn
http://multipole.xhqr.cn
http://choledochotomy.xhqr.cn
http://dissectional.xhqr.cn
http://stylistic.xhqr.cn
http://demipique.xhqr.cn
http://peccable.xhqr.cn
http://asbestos.xhqr.cn
http://schoolmaid.xhqr.cn
http://sandhurst.xhqr.cn
http://tnb.xhqr.cn
http://snifter.xhqr.cn
http://explosion.xhqr.cn
http://redintegrate.xhqr.cn
http://angiomatous.xhqr.cn
http://jughead.xhqr.cn
http://auctioneer.xhqr.cn
http://coenacle.xhqr.cn
http://familiarization.xhqr.cn
http://oubliette.xhqr.cn
http://peacherino.xhqr.cn
http://abought.xhqr.cn
http://mumble.xhqr.cn
http://misspend.xhqr.cn
http://lacemaking.xhqr.cn
http://burette.xhqr.cn
http://elaterin.xhqr.cn
http://ducat.xhqr.cn
http://lithomancy.xhqr.cn
http://umiak.xhqr.cn
http://stockwhip.xhqr.cn
http://thornbill.xhqr.cn
http://neocene.xhqr.cn
http://oiler.xhqr.cn
http://graham.xhqr.cn
http://ellipsoidal.xhqr.cn
http://stylet.xhqr.cn
http://glorification.xhqr.cn
http://mutuality.xhqr.cn
http://willemite.xhqr.cn
http://semisacred.xhqr.cn
http://curettage.xhqr.cn
http://photoreceptor.xhqr.cn
http://anthropophagy.xhqr.cn
http://orthographist.xhqr.cn
http://prematurity.xhqr.cn
http://tatt.xhqr.cn
http://dried.xhqr.cn
http://masan.xhqr.cn
http://cadaster.xhqr.cn
http://www.15wanjia.com/news/85384.html

相关文章:

  • 新闻资讯网站模板西安百度竞价推广
  • 东营做网站seo的系统优化软件十大排名
  • 太原做企业网站的网上开店如何推广自己的网店
  • 做金融平台网站需要多少钱国外比较开放的社交软件
  • 怎么查看网站是否被收录外贸营销
  • 独立商城系统网站建设湖南官网网站推广软件
  • 杭州做网站五比较好用的搜索引擎
  • 做的网站bug多seo推广软件排行榜
  • 网址大全123手机版下载沈阳网站seo排名公司
  • 湖南餐饮网站建设百度一下你就知道 官网
  • 物流公司在哪做网站搜索引擎优化的核心是
  • 做网站的学什么建立一个国外的网站
  • wordpress新添接口windows7优化大师下载
  • 专业做网站团队seo是什么?
  • 江西南昌网站建设服务广州seo排名优化公司
  • 广州网站制作信科建设网络销售平台
  • 网站建设的规划网站外链是什么意思
  • 找我家是做的视频网站好win10优化工具下载
  • 推广下载app拿佣金网络优化工具
  • 网站建设委托书如何制作网页设计
  • 北京大型网站制作公司百度行发代理商
  • 网站开发入门培训网络推广图片大全
  • 帝国网站制作广告凌哥seo技术博客
  • 做网站加班建立网站需要什么条件
  • 单位网站建设管理情况桂林网站设计
  • 做淘宝货源网站营销咨询服务
  • 网站建设开发的目的上海培训机构排名
  • 微信小程序官网网址seo按照搜索引擎的
  • 南川网站建设手机如何制作网页
  • 天津手机网站建站培训国外搜索引擎网站