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

运营推广培训课程太原百度seo排名

运营推广培训课程,太原百度seo排名,山东大良网站建设,深圳公司注销ansible 模块  command 模块 注解:不支持管道和重定向    ansible test -m command -a echo redhat | passwd --stdin mageedu      - chdir        cd into this directory before running the command        [Default: None] 样例&a…

ansible 模块
  command 模块

    注解:不支持管道和重定向
    ansible test -m command -a 'echo redhat | passwd --stdin mageedu'
      - chdir
        cd into this directory before running the command
        [Default: None]

    样例:
    跳到指定目录,执行脚本文件
    ansible test -m command './zhangfengxue.sh chdir=/tmp/'

  shell模块

    注解:支持管道,支持重定向;使用awk 遇到$1 使用\ 进行转义

    ansible test -m shell -a 'echo redhat | passwd --stdin mageedu'

    执行状态:
      绿色:执行成功,并且不需要对目标做变更
      黄色:执行成功,并且需要对目标主机做变更
      红色:执行失败

  copy模块:

    注解:下发文件,下发目录,指定权限,备份,
    ansible test -m copy -a 'src=/root/125.sh dest=/root/3337.sh'

    ansible test -m copy -a 'src=/root/125.sh dest=/root/3337.sh owner=mageedu'

    ansible test -m copy -a "src=/tmp/test  dest=/usr/local/src/"
    常用参数:
      - backup---备份
      - mode---权限
      - owner---所有者
      - group---所属组
    综合样例:
      ansible test -m copy -a 'src=/root/125.sh dest=/root/3337.sh backup=yes owner=admin group=admin mode=0600'

  fetch模块:

    注解:只能拉取文件,不能拉取目录;目标位置有“/”和无“/”的区别
    常用参数:
      src
      dest
      flat
    综合样例:
      ansible test -m fetch -a "src=/etc/hosts dest=/tmp/testdir/ flat=yes"
      ansible test -m fetch -a "src=/etc/hosts dest=/tmp/host flat=yes"

  file模块:
    注解:操作远程主机的文件;设置文件属性;
    常用参数:
      path
      src
      dest
      mode
      state  #touch、link
    综合样例:
      ansible test -m file -a 'path=/opt/3337.sh mode=600'

      ansible test -m file -a 'src=/opt/3337.sh dest=/tmp/77.sh mode=644 state=touch'

      ansible test -m file -a 'src=/opt/3337.sh dest=/tmp/88.sh mode=644 state=link'

  hostname模块:
      注解:修改远程主机名称
    常用参数:
      name
    综合样例:
      ansible test -m hostname -a "name=webserver"

  pip模块:
    注解:python 的包管理工具
    常用参数:
      name
    综合样例:
      ansible test -m pip -a "name=bottle"

  ping模块:

     注解:检测主机存活

   综合样例:

      ansible test -m ping

   yum模块:

      注解:rpm包软件管理工具
    常用参数:
      name
      state
      list
    综合样例:
      ansible test -m yum -a 'name=httpd state=latest'

      ansible test -m yum -a 'name=httpd state=absent'

      ansible test -m yum -a 'name=httpd enablerepo=testing state=present'

      ansible test -m yum -a 'name=httpd-2.2.29 state=present'

         ansible test -m yum -a ‘name=* state=latest’

      ansible test -m yum -a ‘name=http://192.168.56.13/centos7.4/Packages/httpd-2.2.29-1.4.rpm state=present’

      ansible test -m yum -a ‘name=/usr/local/src/nginx-release-centos-6-0.el6.ngx.noarch.rpm state=present’

      ansible test -m yum -a ‘name="@Development tools" state=present’

  service模块:
    控制服务的启动/停止
    常用参数:
      sleep----重启间隔
      state----服务状态
      name----服务名称
    综合样例:

      ansible test -m service -a 'name=httpd state=started'

      ansible test -m service -a 'name=httpd state=stopped'

      ansible test -m service -a 'name=httpd state=restarted'

      ansible test -m service -a 'name=httpd state=reloaded'

      ansible test -m service -a 'name=httpd enabled=yes'

      ansible test -m service -a 'name=httpd  pattern=/usr/local/httpd/bin/httpd state=started'

      ansible test -m service -a 'name=network state=restarted args=eth0'


  user模块:
    用户的管理
    常用参数:
      name
      home
      shell
      user
      group
      comment
      uid
      gid
      comment
      groups

      append

      move_home
    综合样例:

      ansible test -m user -a 'name=johnd comment="John Doe" uid=1040 group=admin'

      ansible test -m user -a 'name=admin home=/opt/admin uid=1000 gid-1000 shell=/bin/sh comment="admin lines" group=root'

      ansible test -m user -a 'name=johnd state=absent remove=yes'

      ansible test -m user -a 'name=ccs home=/opt/ccs move_home=yes'

      ansible test -m user -a 'name=ccs groups=admin,pop append=yes'

  raw:

    注解:不需要python支持,能够执行远程shell;

    综合样例;

      ansible test -m raw -a "chmod a+x /tmp/testfile" 

      ansible test -m raw -a "/tmp/testfile"

  cron:

    注解:计划任务

    常用参数:

      name

      minute

      hour

      day

      month

      weekday

      job

    综合样例:

      ansible test -m cron -a 'name="custom job" minute=*/3 hour=* day=* month=* weekday=* job="/usr/sbin/ntpdate 192.168.134.10"'
      ansible test -m cron -a "name='for test' weekday='2' minute='0' hour='12' user='root' job='cat /etc/passwd >/root/111' cron_file='test ansible'"

  group:

    注解:添加用户组、删除用户组

    常用参数:

      name

      gid

      state

    综合样例:

      ansible test -m group -a "name=zfx state=present"

      ansible test -m group -a "name=zfx gid=4000 state=present"

      ansible test -m group -a "name=zfx state=absent"

  script:

    注解:在远程主机上执行本地主机上的脚本文件(等于=下发到远程主机+执行)

    综合样例:

      ansible test -m script -a "/tmp/testfile" 

  template:

    注解:允许在传输的文件中jinja变量数据

    常用参数:

      和copy模块参数完全相同

    综合样例:

      ansible test -m template -a “src=/temp/foo.j2 dest=/etc/file.conf owner=foo group=foo mode=0644“

   wait_for:

    注解:等待一个动作的变化,如端口激活,文件存在,超时

    常用参数:

      port

      path

      delay

      state

    综合样例;

      ansible test -m wait_for -a "port=8000 delay=10"

      ansible test -m wait_for -a "path=/tmp/foo"

      ansible test -m wait_for -a "path=/var/lock/file.lock state=absent"

  assemble:

    注解:源文件或目录被远程主机的目标文件include进去

    常用参数;

      src

      dest

      archive

    综合样例;

 

      ansible test -m assemble -a "src=/etc/someapp/fragments dest=/etc/someapp/someapp.conf"

      ansible test -m assemble -a 'src=/etc/someapp/fragments dest=/etc/someapp/someapp.conf delimiter='### START FRAGMENT ###''

      ansible test -m assemble -a 'src=/etc/ssh/conf.d/ dest=/etc/ssh/sshd_config validate='/usr/sbin/sshd -t -f %s''

   synchronize

    注解:类似于rsync,将本地文件下发到远程主机

    常用参数:

      src

      dest

      archive

    综合样例:

      ansible test -m synchronize -a "src=/root/testrsync dest=/tmp/. "

      ansible test -m synchronize -a "src=/root/testrsync dest=/tmp/. archive=no"

 

转载于:https://www.cnblogs.com/fengjiu/p/8391976.html

http://www.lbrq.cn/news/2639305.html

相关文章:

  • 学校网站建设栏目设置网上推广平台有哪些
  • 河北省住房和城市建设局采购网站免费域名注册平台
  • 如何在手机使用wordpress英文网站seo
  • 服务器除了做网站还能做什么美国搜索引擎排名
  • 手机网站建设项目百度关键词搜索量统计
  • 专门做美女写真的网站网站怎么接广告
  • 企业网站打不开什么原因晋中网络推广
  • 网站后台上传不了文件seo和sem是什么
  • 银川网站建设多少钱网站优化seo怎么做
  • 新思维网站在百度上打广告找谁推广产品
  • 甘肃三轮建设监理网站网站建设的重要性
  • 贵州城市和城乡建设官方网站seo培训课程
  • 从做系统网站的收藏怎么找回营销计划书7个步骤
  • 双辽做网站品牌推广与传播怎么写
  • 百度微信官网网站模板百度推广账户登录首页
  • 直播做ppt的网站成都进入搜索热度前五
  • 笔记本电脑可以做网站服务器营业推广策划方案
  • 东莞网站建设aj工作室搜索引擎哪个最好用
  • win7架设asp网站微博推广有用吗
  • 网站关键词怎么做效果好郑州seo代理外包公司
  • 上市公司网站建设湖南网络优化服务
  • 政府网站建设工作整改报告自己怎么做关键词优化
  • 检查网站有没有做301免费推广渠道有哪些
  • wordpress支持 nginxseo关键词优化指南
  • 昆山网站建设推荐百度站长工具怎么关闭教程视频
  • 重庆网站建设设计公司哪家好百度推广登录入口
  • 做网站最常用的软件是什么2020国内十大小说网站排名
  • 网站url超链接怎么做最佳搜索引擎磁力
  • 京东联盟怎么做CMS网站百度信息流投放方式有哪些
  • 广州建设网站的公司哪家好每日精选12条新闻
  • Pytest项目_day08(setup、teardown前置后置操作)
  • Word中怎样插入特殊符号
  • 3-防火墙
  • HTTP 请求返回状态码和具体含义?200、400、403、404、502、503、504等
  • WinForm 对话框的 Show 与 ShowDialog:阻塞与非阻塞的抉择
  • Ubuntu 系统 Docker 启动失败(iptables/nf\_tables)