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

增城网站建设wordpress如何设置上传图片的大小

增城网站建设,wordpress如何设置上传图片的大小,免费网站推广渠道,在ps中如何做网站框架剧本语言 剧本使用的yaml语言 yaml文件的后缀为.yml或者.yaml 使用空格做为缩进 相同层级的元素左侧对齐即可 缩进时不允许使用 Tab 键,只允许使用空格 创建剧本 直接编辑不存在会自动创建这个文件,先用touch新建也行 vim juben.yml编写剧本 hosts&am…

剧本语言

剧本使用的yaml语言

yaml文件的后缀为.yml或者.yaml
使用空格做为缩进
相同层级的元素左侧对齐即可
缩进时不允许使用 Tab 键,只允许使用空格

创建剧本

直接编辑不存在会自动创建这个文件,先用touch新建也行

vim juben.yml

编写剧本
hosts:指定的需要操作的主机
vars:指定的是变量(非必须)
tasks: 具体要执行的任务
name:任务名称
shell:shell模块

- hosts: alltasks:- name: 在所有主机上新建monster.ymlshell: touch /data/monster/monster.yml

剧本执行

执行前可以加"–check"或"-C"检查剧本格式是否有错误

[root@monster1 ~]# ansible-playbook juben.yml -CPLAY [all] ********************************************************************************************************************************************TASK [Gathering Facts] ********************************************************************************************************************************
ok: [192.168.71.137]TASK [在所有主机上新建monster.yml] ****************************************************************************************************************************
skipping: [192.168.71.137]PLAY RECAP ********************************************************************************************************************************************
192.168.71.137             : ok=1    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   [root@monster1 ~]#

没有问题再把-C去掉正式执行,中间有个告警直接无视掉,它建议新建文件使用file模块,我们剧本里面使用的shell模块

[root@monster1 ~]# ansible-playbook juben.ymlPLAY [all] ********************************************************************************************************************************************TASK [Gathering Facts] ********************************************************************************************************************************
ok: [192.168.71.137]TASK [在所有主机上新建monster.yml] ****************************************************************************************************************************[WARNING]: Consider using the file module with state=touch rather than running 'touch'.  If you need to use command because file is insufficient you
can add 'warn: false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.changed: [192.168.71.137]PLAY RECAP ********************************************************************************************************************************************
192.168.71.137             : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   [root@monster1 ~]# 

趣味风格cowsay

执行过程中输出一大堆信息,你觉得比较乏味可以安装cowsay
安装cowsay后默认将你的过程输出信息显示奶牛图案

yum install -y cowsay

安装好后,再执行脚本看效果

[root@monster1 ~]# ansible-playbook juben.yml____________
< PLAY [all] >------------\   ^__^\  (oo)\_______(__)\       )\/\||----w |||     ||________________________
< TASK [Gathering Facts] >------------------------\   ^__^\  (oo)\_______(__)\       )\/\||----w |||     ||ok: [192.168.71.137]____________________________
< TASK [在所有主机上新建monster.yml] >----------------------------\   ^__^\  (oo)\_______(__)\       )\/\||----w |||     ||[WARNING]: Consider using the file module with state=touch rather than running 'touch'.  If you need to use command because file is insufficient you
can add 'warn: false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.changed: [192.168.71.137]____________
< PLAY RECAP >------------\   ^__^\  (oo)\_______(__)\       )\/\||----w |||     ||192.168.71.137             : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   [root@monster1 ~]# 

更换图案

前面说了奶牛是默认图案,可以使用cowsay -l显示所有可以选择的图案。比如龙,执行cowsay -f 图案 内容可以看到预览效果。

[root@monster1 ~]# cowsay -l
Cow files in /usr/share/cowsay:
beavis.zen blowfish bong bud-frogs bunny cheese cower default dragon
dragon-and-cow elephant elephant-in-snake eyes flaming-sheep ghostbusters
head-in hellokitty kiss kitty koala kosh luke-koala mech-and-cow meow milk
moofasa moose mutilated ren satanic sheep skeleton small sodomized
stegosaurus stimpy supermilker surgery telebears three-eyes turkey turtle
tux udder vader vader-koala www
[root@monster1 ~]# cowsay -f dragon 火龙喷死你!!!__________
< 火龙喷死你!!! >----------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~
[root@monster1 ~]# 

效果知道想要哪个了,怎么更改默认输出自己想要的表情图案呢
编辑ansible.cfg文件

vim /etc/ansible/ansible.cfg 

在223行,复制一行出来修改成自己要修改的图案,不复制直接修改default也行

在这里插入图片描述
执行剧本查看效果

在这里插入图片描述

剧本任务案例

1.在所有主机/data/下创建monster目录
2.在monster下创建monster.log文件
3.docker安装redis
4.编写定时任务每分钟记录一下docker所有容器性能状态日志到monster.log

编写案例剧本

vim anli.yml
- hosts: alltasks:- name: 任务1、创建monster目录file: path=/data/monster state=directory- name: 任务2、创建monster.logfile: path=/data/monster/monster.log state=touch- name: 任务3、安装redisshell: |docker pull redisdocker run --restart=always --log-opt max-size=100m --log-opt max-file=2 -p 6379:6379 --name redis -d redis- name: 任务4、docker所有容器性能监控写入monster.logcron: name=dockerlog minute=*/1 job="docker stats --no-stream | awk '{if(NR > 1){print $0}}'  >> /data/monster/monster.log" state=present

检查有无问题

[@monster1 ~]# ansible-playbook anli.yml -C____________
< PLAY [all] >------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~________________________
< TASK [Gathering Facts] >------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~ok: [192.168.71.137]________________________
< TASK [任务1、创建monster目录] >------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~changed: [192.168.71.137]__________________________
< TASK [任务2、创建monster.log] >--------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~ok: [192.168.71.137]____________________
< TASK [任务3、安装redis] >--------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~skipping: [192.168.71.137]________________________________________
< TASK [任务4、docker所有容器性能监控写入monster.log] >----------------------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~skipping: [192.168.71.137]____________
< PLAY RECAP >------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~192.168.71.137             : ok=3    changed=1    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   

执行剧本

[root@monster1 ~]# ansible-playbook anli.yml ____________
< PLAY [all] >------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~________________________
< TASK [Gathering Facts] >------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~ok: [192.168.71.137]________________________
< TASK [任务1、创建monster目录] >------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~ok: [192.168.71.137]__________________________
< TASK [任务2、创建monster.log] >--------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~changed: [192.168.71.137]____________________
< TASK [任务3、安装redis] >--------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~changed: [192.168.71.137]________________________________________
< TASK [任务4、docker所有容器性能监控写入monster.log] >----------------------------------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~changed: [192.168.71.137]____________
< PLAY RECAP >------------\                    / \  //\\    |\___/|      /   \//  \\/0  0  \__  /    //  | \ \    /     /  \/_/    //   |  \  \  @_^_@'/   \/_   //    |   \   \ //_^_/     \/_ //     |    \    \( //) |        \///      |     \     \( / /) _|_ /   )  //       |      \     _\( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.(( / / )) ,-{        _      `-.|.-~-.           .~         `.(( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \(( /// ))      `.   {            }                   /      \  \(( / ))     .----~-.\        \-'                 .~         \  `. \^-.///.----..>        \             _ -~             `.  ^-`  ^-_///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~/.-~192.168.71.137             : ok=5    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   [root@monster1 ~]# 

到被分发的服务器验证,目录创建了,查看monster.log,里面也在记录,查看定时任务里面的内容正是我们剧本里面编辑好的

在这里插入图片描述

http://www.dtcms.com/wzjs/781551.html

相关文章:

  • 建设公司网站的必要性wordpress文章无法中文
  • 旅游区网站建设深圳平湖做网站
  • 网站的成功案例wordpress主题插件下载失败
  • 用wordpress建站会不会显得水平差wordpress视频设置方法
  • 域名多少钱一年手机端网站优化怎么做
  • 网站开发经理搜索引擎优化的主要特征
  • 网站后台jsp怎么做分页智慧城市
  • 电子商务网站建设评估的工具哈尔滨 做网站公司哪家好
  • 宁波营销型网站建设潍坊网站建设平台
  • 东营网站搜索引擎优化美食网站 怎么做
  • 成都市网站建wordpress用thinkphp
  • 深圳网站建设信科网络网站用户量
  • 智能网站建设加工温州网站制作企业
  • 企业网站托管代运营wordpress用户认证
  • 校园网站策划书摄影网站功能设计
  • 十大网站排行榜上海前100强企业名单
  • 河南网站建设yijuce什么是整合营销并举例说明
  • 宁波建设银行做搜狗网站优化排名软
  • 大连承揽营销型网站公司文昌品牌网站建设费用
  • 网站建设一键搭建企业网站主页素描模板
  • 网站模板内容怎么改可以做用户画像的网站
  • 深圳专业做网站开发费用网站被k的怎么办
  • 网站建设 前端 后端校园网站建设的开题报告
  • 上海最新发布百度seo整站优化
  • 搭建网站的手机软件制作网页如何添加图片
  • 郑州市网站开发我想在百度发布信息
  • 网站建设贰金手指下拉贰拾网站类网站建设
  • 重庆专业的网站建设公司排名个人网页的内容模板设计
  • 怎么免费建设个人网站推广展示类网站
  • 那些网站做的非常好看网站推广策略含义