cs1.6插件安装教程 cs如何安装插件

众所周知,被誉为“亚洲四大邪术”之首的中国PS术,无论你是高是瘦,黑白是多丑,只要学会了这个术,你就会变高,变瘦,变白,小眼睛变大,小嘴巴变小,黄牙变白。都是分分钟的事,完全可以P自己。今天边肖为大家带来2019年最新人像美颜扩展面板插件——DR5最新十月版。

7e01030ab44d44cba73213607d5b4beb?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=6Sl72vHRLRkqhQB5nX8AJ8uakIY%3D&index=0

DR5是旧版本DR3、4和5.0的升级版本。功能更强大,速度更快,运行稳定,效果比Portraiture3插件更好。你没必要去学高低频剥皮,中性灰剥皮,双曲线剥皮。可以直接一键使用。

(版本支持:PSCS-CC 2019;支持系统:Win系统、Mac系统)

1.画面太暗,可以选择阴影修复功能键修复,画面会高亮显示;

2b21b02d9e9648e6aadbc08f94eb4fe7?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=InoJZk74ltdJ0pH7ciWgAx3omMk%3D&index=1

db49fdf3127249668bc38d83c862c2e8?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=LnZyex3G476TmMB3rLBVrgsvrS0%3D&index=2

2、无光,来,点击光晕,适当调整效果层位置,效果就出来了;

bbb4fe2e83b144ea824618b27c1e4fdc?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=iERdLF9IbRn9N9Ed06lI5bLKmRQ%3D&index=3

3.也可以适当提升嘴唇的颜色~但是出来的是带面膜的一层。需要用白色软边刷沿着嘴唇画,效果就出来了~

f052281571d0493b83fddb3aef27973c?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=g%2B3FTP8SGNBeeynioPpYtBbcLhs%3D&index=4

适用软件:PS CC 2015 — CC2019

适用系统:WIN/MAC

语言:一键安装即是汉化版

领取方式见文末哦~

插件介绍及效果预览

d34309bcabeb4ac5b64208ee97c14ce4?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=Onxj4ehEMEhxlFF%2Bv3d9KxCVlHU%3D&index=5

2a5369d07813404d9ff43507a5bd312e?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=9ple28TLl7CyKe5aT0m2vrF1K8E%3D&index=6

不仅如此,你还可以给照片添加各种你想要的效果。

570d6fbaa5ae48199f11764a382dab04?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=XG58ZxY8NUWqeuKh2ysTz5CNWpg%3D&index=7

比如一键选择专业工笔画,曾~效果就出来了;

9dd2dfc6a473498e9d49534bdf681a1a?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=mSBaN%2F3rBoI%2FgG4WhU9s71Wj5Jo%3D&index=8

比如想要素描效果,点击线描工笔画,一键搞定。是不是很神奇~

389a4fc1950c48198d980d4e20b2aeb6?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=zdtCe28rmq1L9cEgYMqP3zGktL8%3D&index=9

更神奇的是,想要光效,再也不需要用PS里的-滤镜-渲染-镜头光晕了。只要点一下模糊,光晕效果就出来了~

9c30d22c427e425ca4423a5f26571a48?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=WNVPWu9iGvHp6WaT9um9tJe7OWo%3D&index=10

这个,这个,简直就是神仙,所以提高工作效率最好的方法就是找到这个插件,安装好,不用学了。小白将一键使用它。

27c716d70b7f4e7db6f96626c37a6290?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=86jY%2FfJnqVBq4dwggUfO89Bq5mE%3D&index=11

不得不说,有了这个插件的安装,工作效率变得非常高。

更新插件的新功能简直太酷了!

最后,这款插件里有安装方法,直接照着安装就好,实在不会私信我哦~

免费领取DR5插件的方式如下:评论区评论:DR5插件私信我:记得转发DR5插件给我。DR5插件免费提供,转发的时候要小心哦~ ~ ~

53ac9da71a3e4ec7ad6d9ed31883a6ee?_iz=31825&from=article.detail&x-expires=1702497299&x-signature=9eXWFQe3Qv96A98IfvPzqljqwBI%3D&index=12

cs如何安装插件

「运维箴言:重启试试」

检查插件是Jinja2模板化语言的Ansible扩展。这些插件使Ansible能够使用外部来源的数据,如文件和壳环境。

默认的Ansible安装中有几十个可用的插件ansible-doc-t lookup -l,获取可用查找插件的完整列表。

[student @ workstation数据-过滤器]$ ansi ble-doc-t lookup-l \ naws _ account _ attribute查找美国焊接协会帐户属性aws_secret查找存储在AWS机密管理器中的机密\ n新服务ip范围查找自动警报系统中提供的服务(如EC2和S3)的互联网协议(Internet Protocol的缩写)范围aws_ssm获取地对地导弹参数或路径下所有参数的值\ n卡特琳娜返回列表的笛卡尔乘积\ n可以运行ansi ble-doct查找插件名称命令。我们随便看一个模块

[root@vms81.liruilongs.github.io]-[~/ansible]$ansible-doc-t查找变量变量(/usr/lib/python 2.7/site-packages/ansi ble/plugins/lookup/vars。py)\ n \ n检索ansi ble变量的值 *此模块由脆弱社区维护选项(=强制):=_terms要查找的变量名% 22 \ n.嗯,获取一个Ansible变量的值,顺便研究下代码怎么写

[root@vms81.liruilongs.github.io]-[~/ansible]$cat/usr/lib/python 2.7/站点包/ansi ble/plugins/lookup/vars。py \ n #(c)2017 ansi ble项目\ n # GNU通用公共许可证3.0版(参见复制或https://www。GNU。org/licenses/GPL-3.0。txt)\ n from _ _ future _ _ import(absolute _ import,division,print _ function)\ n _ _ meta class _ _=type \ n \ n # #一些模块的说明\ n document=' ' ' \ n查找:vars \ n作者:Ansible Core \ n版本_添加:“2.5”\ n简短_描述:查找变量的模板值描述: -检索ansi ble变量的值% 22 \ n选项: _terms:描述:要查找的变量名% 22 \ n必选:真默认值:描述: -如果变量未定义,则返回什么% 22 \ n-如果没有设置默认值,如果有任何变量未定义,将会导致错误\ n ' ' ' \ n # #模块使用方法\ n \ u \ u \ u \ u \ n \ n return=' ' ' \ n _ value:\ n描述: -请求的变量的值''''\ n \ n来自ansi ble。错误导入AnsibleError,AnsibleUndefinedVariable \ n来自ansi ble。模块_实用程序。六导入来自ansi ble的string _ types。插件。检查导入查找基础类查找模块(LookupBase): ##只有一个方法,接收所有参数 def run(self,terms,variables=None,**kwargs): #变量不为没有人的话如果变量不是无:自己._圣殿骑士。available _ variables=variables \ n my vars=get attr(self ._templar,' _available_variables '{ })\ n \ n self。set _ options(direct=kwargs)\ n default=self。get _ option(' default ')\ n \ n ret=[]\ n for term in term:\ n if not is instance(term,string_types):引发AnsibleError('无效的设置标识符,' %s '不是字符串,其a %s' % (term,type(term)))\ n \ n try:\ n try:\ n value=my vars[term]\ n except _ templator。template(value,fail _ on _ undefined=True))\ n AnsibleUndefinedVariable除外:\ n如果系统默认值不是无:\ n返回。追加(默认)\ n否则:\ n提高\ n \ n返回\ n可以看到,和回调插件的编写方式类似,继承基类,重写方法。主要用于根据变量名获取当前剧本中的变量,变量名可以是经过运行的变量,我编写一个演示来测试下

-\ n-name:vars Demo \ n hosts:master \ n tasks:\ n-name:Show ' variablename '的值\ n debug:\ n msg:“{ { lookup(' vars '' variabl ' myvar)} }”\ n vars:\ n variablename:hello \ n myvar:ename \ n \ n-name:显示默认为空,因为我没有变量注释名称“\ n调试:\ n消息:“{ { lookup(' vars '' variabl ' myvar,default=”变量不存在)} } ' \ n vars:\ n variablename:hello \ n myvar:note name \ n \ n-name:产生一个错误,因为我没有变量notename ' 调试:消息:' {{ lookup('vars '' variabl ' myvar)} } ' \ n ignore _ errors:True \ n vars:\ n variablename:hello \ n myvar:note name \ n \ n-name:查找几个相关的变量\ n调试:\ n消息:“{ { lookup(' vars '' ansi ble _ play _ play ansi ble _ play _ batch '' ansi ble _ play _ hosts _ all ')} }”\ n \ n-name:在循环中查找某些”前缀变量”的替代方法\ n调试:\ n消息:“{ { lookup(' vars '' ansi ble _ play _ ' item)} }”\ n循环:\ n-hosts \ n-batch \ n-hosts_all[root@vms81.liruilongs.github.io]-[~/ansible]$ansible-playbook变量。 YAML \ n \ n玩[vars演示]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n \ n任务[收集事实变量不存在\ n } \ n \ n任务[产生一个错误,因为我没有变量notename ']* * * * * * * * * * * * * * * * * * * \ n致命:[192.168.26.81]:失败!={'msg ''该任务包含一个带有未定义变量的选项。错误是:找不到具有此名称的变量:变量名称\ \ \错误似乎出现在”/root/ansible/vars.yaml “:第19行第5列,但可能\ \ n出现在文件的其他位置,具体取决于确切的语法问题. n\出错的行似乎是:\\\ -名称:产生一个错误,因为我在这里没有变量注释名' \ \ n ^ \ \ n ' } \ n.忽略\ n \ n任务[查找几个相关变量]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ NOK:[192。168 .26 .81]={ \ n ' msg '[ [ '192 . 168 . 26 . 81 ' \ n],\ n[\ n ' 192。168 .26 .81 ' \ n], [ '192.168.26.81' ] ]可以使用检查和询问来调用查找插件。使用方法与过滤器相似;指定函数的名称,并在括号中添加要调用的查找插件的名称以及该插件所需的所有参数。

可以使用两个Jinja2模板函数(查找或查询)中的一个来调用插件。

这两种方法都具有和过滤器非常相似的语法。指定函数的名称,并在圆括号中指定要调用的检查插件的名称和插件需要的任何参数。

通过检查的文件插件获取指定文件的内容,编写剧本

-name:lookup Demo \ n hosts:master \ n vars:\ n hosts:” { { lookup(' file ''/etc/hosts ')} } ” \ n tasks:\ n-debug:\ n var:hosts \ n模拟执行剧本

[root@vms81.liruilongs.github.io]-[~/ansible]$ansible-playbook金贾2。YAML-c \ n玩[查找演示]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[收集事实]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[192.168 . 26 .81]\ n任务[调试]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *,ok: [192.168.26.81]使用逗号分隔,可以在文件插件中包含多个文件名:

-name:lookup Demo \ n hosts:master \ n vars:\ n issue:” { { lookup(' file ''/etc/hosts ''/etc/issue ')} }”\ n任务: – debug: var: issue在Ansible 2.5和更高版本中,可以使用询问函数,而不是检查来调用查找插件。两者之间的区别在于,查询始终会返回个更容易解析和使用的列表,而不是返回逗号分隔的值。

[root@vms81.liruilongs.github.io]-[~/ansible]$ansible-playbook查询。YAML \ n播放[查询]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 任务[收集事实]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[192 . 168 .26 .81]\ n任务[调试]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n正常:[调试]那这里有一个问题,查找获取文件的内容适控制节点,还是被控节点,实际上是控制节点

文件插件允许Ansible将本地文件的内容加载到变量。来看一个传递嘘密钥的演示

[root@vms81.liruilongs.github.io]-[~/ansible]$ssh根@ VMs 82。李瑞龙。github。超正析象管用户添加fred[root@vms81.liruilongs.github.io]-[~/ansible]$ssh根@ VMs 82。李瑞龙。github。超正析象管用户添加naoko[root@vms81.liruilongs.github.io]-[~/ansible]$[root@vms81.liruilongs.github.io]-[~/ansible]$ssh-keygen-n ' '-福雷德。密钥\ n生成公钥/私钥对% 22 \ n您的标识已保存在弗雷德基中,您的公钥已保存在弗雷德.基.酒馆中,\ n密钥指纹为:\ nsha 256:aabygrfjkr 2 zllyikm 0 dcbxhaevt/5 flw n6 jy/oaxn 8 root @ VMs 81。李瑞龙。github。io \ n密钥的兰多玛特图像为: – [RSA 2048] – |* .=.|| B.o .| \ n | o=100 . 00 | \ n | oooo .||=.S || *.|| .==.o.||o * o=* .oo .* b=o . e | \ n-[沙256]-[root@vms81.liruilongs.github.io]-[~/ansible]$ssh-keygen-n ' '-f直子。密钥\ n生成公钥/私钥南非共和国密钥对% 22 \ n您的标识已保存在naoko.key中,您的公钥已保存在naoko.key.pub中,\ n密钥指纹为:\ nsha 256:udtuesesooboztiungph 4v jola 3 mwvqekwp 6 wdoexwai root @ VMs 81。李瑞龙。github。io \ n密钥的兰多玛特图像为:\ n-[RSA 2048]-\ n | . o=o | \ n | .哦.o o ||o.o. o ||E . o .||.=S || .| \ n |嘘. | \ n | @=| \ n | x * o | \ n-[沙256]-[root@vms81.liruilongs.github.io]-[~/ansible]$[root@vms81.liruilongs.github.io]-[~/ansible]$ls | grep key \ n red .钥匙\ n红色。钥匙。pub \ n直子。钥匙\ n直子。钥匙。发布名称:添加授权密钥主机:192.168.26.82变量:用户: -弗雷德 -直子任务:\ n-名称:添加密钥 authorized_key:用户:” { { item } }”\ n密钥:””组=1001(fred)[root@vms81.liruilongs.github.io]-[~/ansible]$ssh-i直子。键直子@ VMs 82。李瑞龙。github。io id \ nuid=1002(Naoko)GID=1002(Naoko)组=1002(naoko)[root@vms81.liruilongs.github.io]-[~/ansible]$对于公钥的获取,也可以直接通过变量拼接,不使用运算符。

密钥:” {{ lookup('file '' { { item } }。钥匙。pub ')} }”\ n如果文件是JSON或YAML格式,可以使用from_yaml或from_json过滤器将其解析为正确结构化的数据:

我们读取一个豆荚资源文件试试

-\ n名称:YAML到vars \ n主机:192。168 .26 .82 \ n任务:\ n-name:show YAML \ n debug:\ n var:' lookup(' file '' static-pod。YAML ')|来自YAML ' \ n \ n-\ n版本:v1 \ n种类:pod \ n元数据: creationTimestamp: null标签:运行:pod-static名称:pod-静态名称空间:默认spec: static-Pod。YAML))| from _ YAML '{ \ n ' API version '' v1 ' 'kind' 'Pod '\ n ' metadata '{ \ n ' creation timestamp 'null,\ n ' labels '{ \ n ' run '' Pod-static ' \ n }, 'name' 'pod-static '\ n ' namespace '' default ' \ n },\ n ' spec '{ \ n ' containers '[\ n { \ n ' image '' nginx '\ n ' imagePullPolicy ''如果不存在'也是一样的,我们来看一下,这是传递一个码头工人加速器设置

[root@vms81.liruilongs.github.io]-[~/ansible]$cat守护进程。注册镜像'['https://2tefyfv7.mirror.aliyuncs.com']}[root@vms81.liruilongs.github.io]-[~/ansible]$cat文件。YAML \ n-\ n-name:JSON to vars \ n hosts:192。168 .26 .82 \ n任务: – debug: var: lookup('file '' daemon。)| from_json[root@vms81.liruilongs.github.io]-[~/ansible]$ansible-playbook文件_json。YAML \ n \ n play[JSON to vars]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n插件查询控制节点初始化设置文件的后缀名格式文件特定参数值。

– -名称:查找或查询播放\ n主机:192。168 .26 .82 \ n gather _ facts:false \ n任务:\ n-debug:\ n消息:\ n文件/etc/foo中得名字.初始化设置文件的后缀名部分李瑞龙是{{ lookup('ini '' first _ name lest _ name section=李瑞龙file=/etc/foo。')}}[root@vms81.liruilongs.github.io]-[~/ansible]$ansible-playbook文件。YAML \ n \ 播放[查找或查询播放]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *。 *不知道n任务[调试]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ini部分李瑞龙是[]\ \ n ' \ n } \ n \ n播放摘要* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n 192.168。 26 .82:ok=1已更改=0无法访问=0失败=0跳过=0已营救=0忽略=0使用模板应用数据与文件插件一样,模板插件也会返回文件的内容,不同之处在于,模板插件预期文件内容为Jinja2模板,并在应用之前评估该模板。

[root@vms81.liruilongs.github.io]-[~/ansible]$echo“你好{ { name } }”你好。J2 \ n-\ n-名称:模板演示\ n主机:192。168 .26 .82 \ n变量:\ n名称:李瑞龙\ n任务:\ n-name:mes deml \ n调试:\ n var:查找('模板''hello.j2')[root@vms81.liruilongs.github.io]-[~/ansible]$ansible-playbook template _ demo。YAML \ n[警告]:找到了使用保留名称的变量:name \ n \ n play[模板演示]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *读取控制节点上的环境变量包封/包围(动词包围的简写)插件查询控制节点环境变量。当控制主机是容器化的应用程序,并且将环境变量注入配置图和秘密到主机中时,此功能很有用。

– -名称:查找或查询播放\ n主机:192。168 .26 .82 \ n任务:\ n-name:show env LANG \ n debug:\ n var:lookup(' env '' LANG ')\ n-name:show env \ n debug:\ n var:ansi ble _ env \ n \ 播放[查找或查询播放]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *。 * * * * * * * * * * * * * * * \ n \ n任务[收集事实]UTF-8 ' \ n } \ n \ n task[show env]* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *[192。 168 .26 .82]={ \ n ' ansi ble _ env '{ \ n ' HOME ''/root ' 'LANG' 'zh_CN .' UTF-8 ' '较少打开'' | |/usr/bin/较少管道。sh % s '\ n '日志名:' root '\ n ' LS _ COLORS '' RS=0:di=38;5;27:ln=38;5;51:MH=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:BD=48;5;232;38;5;11:CD=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:苏=48;5;196;38;5;15:SG=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:ST=48;5;21;38;5;15:ex=38;5;34:*.tar=3859:*.tgz=3859:*.弧=38 ;5;9:*.arj=3859:*.taz=3859:*.lha=3859:* lz4=38;5;9:*.lzh=3859:*.lzma=3859:*.tlz=3859:*.txz=3859:*.tzo=3859:* t7z=38;5;9:*.zip=3859:*.z=3859:*.Z=3859:*.dz=3859:*.gz=3859:*.lrz=3859:*.lz=3859:*.lzo=3859:*.xz=3859:* .bz2=385;9:*.bz=3859:*.tbz=3859:* .tbz 2=385;9:*.tz=3859:*.deb=3859:*.rpm=3859:*.jar=385

9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:”, “MAIL”: “/var/mail/root”, “PATH”: “/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin”, “PWD”: “/root”, “SHELL”: “/bin/bash”, “SHLVL”: “2”, “SSH_CLIENT”: “192.168.26.81 43056 22”, “SSH_CONNECTION”: “192.168.26.81 43056 192.168.26.82 22”, “SSH_TTY”: “/dev/pts/0”, “TERM”: “xterm-256color”, “USER”: “root”, “XDG_RUNTIME_DIR”: “/run/user/0”, “XDG_SESSION_ID”: “2”, “_”: “/usr/bin/python” }}PLAY RECAP *************************************************************************************************************192.168.26.82 : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0读取控制节点执行命令输出

pipe 和lines插件都在Ansible控制节点上运行命令,并返回输出。pipe 插件返回命令生成的原始输出,lines 插件将该命令的输出拆分为行。

—- name: pipe & lines demo hosts: 192.168.26.82 tasks: – name: pipe demo debug: var: lookup(‘pipe’ , ‘pwd’,’uname -a’,’ls -l k8s-volume-create/’) – name: lines demo debug: var: lookup(‘lines’, ‘pwd’,’uname -a’,’ls -l k8s-volume-create/’)

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible-playbook pipe_demo.yamlPLAY [pipe & lines demo] ****************************************************************************TASK [Gathering Facts] ******************************************************************************ok: [192.168.26.82]TASK [pipe demo] ************************************************************************************ok: [192.168.26.82] =>> { “lookup(‘pipe’ , ‘pwd’,’uname -a’,’ls -l k8s-volume-create/’)”: “/root/ansible,Linux vms81.liruilongs.github.io 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux,总用量 40\drwxr-xr-x 2 root root 135 12月 1 19:54 nfsdy\-rw-r–r– 1 root root 442 12月 1 23:04 pod_storageclass.yaml\-rw-r–r– 1 root root 438 11月 27 17:14 PodVolumeHostPath.yaml\-rw-r–r– 1 root root 478 11月 28 11:10 podvolumenfs.yaml\-rw-r–r– 1 root root 695 11月 27 16:15 pod_volume_r.yaml\-rw-r–r– 1 root root 206 11月 28 17:17 pod_volumes-pvc.yaml\-rw-r–r– 1 root root 442 11 月 28 17:43 pod_volumespvc.yaml\-rw-r–r– 1 root root 615 11月 27 15:51 pod_volumes.yaml\-rw-r–r– 1 root root 646 11月 27 15:28 pod_volume.yaml\-rw-r–r– 1 root root 330 11月 28 17:18 pod_volunms-pv.yaml\-rw-r–r– 1 root root 199 12月 1 20:15 pvc_nfs.yaml”}TASK [lines demo] ***********************************************************************************ok: [192.168.26.82] =>> { “lookup(‘lines’, ‘pwd’,’uname -a’,’ls -l k8s-volume-create/’)”: “/root/ansible,Linux vms81.liruilongs.github.io 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux,总用量 40,drwxr-xr-x 2 root root 135 12月 1 19:54 nfsdy,-rw-r–r– 1 root root 442 12月 1 23:04 pod_storageclass.yaml,-rw-r–r– 1 root root 438 11月 27 17:14 PodVolumeHostPath.yaml,-rw-r–r– 1 root root 478 11月 28 11:10 podvolumenfs.yaml,-rw-r–r– 1 root root 695 11月 27 16:15 pod_volume_r.yaml,-rw-r–r– 1 root root 206 11月 28 17:17 pod_volumes-pvc.yaml,-rw-r–r– 1 root root 442 11月 28 17:43 pod_volumespvc.yaml,-rw-r–r– 1 root root 615 11月 27 15:51 pod_volumes.yaml,-rw-r–r– 1 root root 646 11月 27 15:28 pod_volume.yaml,-rw-r–r– 1 root root 330 11月 28 17:18 pod_volunms-pv.yaml,-rw-r–r– 1 root root 199 12月 1 20:15 pvc_nfs.yaml”}PLAY RECAP ******************************************************************************************192.168.26.82 : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

看一个简单的

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible master -m debug -a “msg={{ query(‘lines’, ‘ls /etc/host*’)}}”192.168.26.81 | SUCCESS =>> { “msg”: [ “/etc/host.conf”, “/etc/hostname”, “/etc/hosts”, “/etc/hosts.allow”, “/etc/hosts.deny” ]}

lookup使用fileglob插件,返回逗号分隔的文件名清单。

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible master -m debug -a “msg={{ lookup(‘fileglob’, ‘/etc/hosts*’) }}”192.168.26.81 | SUCCESS =>> { “msg”: “/etc/hosts,/etc/hosts.allow,/etc/hosts.deny”}

query使用fileglob插件,强制返回文件列表值。

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible master -m debug -a “msg={{ query(‘fileglob’, ‘/etc/hosts*’) }}”192.168.26.81 | SUCCESS =>> { “msg”: [ “/etc/hosts”, “/etc/hosts.allow”, “/etc/hosts.deny” ]}从 URL 获取内容

url 插件从 URL 获取内容:

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible master -m debug -a “msg={{ query(‘url’, ‘https://liruilongs.github.io/’) }}”192.168.26.81 | SUCCESS =>> { “msg”: [ “<!doctype html>>”, “<html lang=\”zh\”>><head>><meta charset=\”utf-8\”>><meta name=\”viewport\” content=\”width=”360px”,height=”auto” />>

同时具有许多选项用于控制身份验证、web代理或将结果拆分为行等。

k8s 插件通过 openshift Python 模块提供对 Kubernetes API 的完全访问权限。必须使用 kind 选项来提供对象类型:

– name: k8s demo hosts: 192.168.26.81 tasks: – name: debug demo k8s debug: var: lookup(‘k8s’,kind=’pod’,namespect=’kube-system’,resource_name=’kube-proxy’)

注意:k8s 插件是一个 lookup 插件,主要用途是从 Kubernetes 集群提取信息,而不是对其进行更新。使用 k8s模块来管理 Kubernetes 集群。

– name: Fetch all deployments set_fact: deployments: “{{ lookup(k8s’,kind=’Deployment)}”- name: Fetch all deployments in a namespace set_fact: deployments: “{{ lookup(k8s’,kind=’Deployment’,namespace=’testing)}}”- name: Fetch a specific deployment by name set_fact: deployments: {{ lookup(k8s’,kind=’Deployment’,namespace=’testing, resource_name=’elastic)}}- name: Fetch with label selector set_fact: service: “{{ lookup(‘k8s’,kind=’Service’,label_ selector=’app=galaxy’) }}”

这个Demo有问题,之后需要在看下

查询插件etcd,redis,mongodb还可以从数据库中获取信息。

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible-doc -t lookup etcd

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible master -m debug -a “msg={{ lookup(‘etcd’, ‘foo’)}} “192.168.26.81 | SUCCESS =>> { “msg”: “”}

– name: a value from a locally running etcd debug: msg: “{{ lookup(‘etcd’, ‘foo/bar’)}”- name: “values from multiple folders on a locally running etcd” debug: msg: “{{ lookup(‘etcd’, ‘foo’,’bar’,’baz’)}}”- name: “since Ansible 2.5 you can set server options inline” debug: msg: “{{ lookup(‘etcd’,’foo’, version=’v2′, url=’http://192.168.0.27′) }}”password插件生成密码

password插件可用于创建用户密码,并保存在文件中。、

┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ansible 192.168.26.82 -m user -a “name=liruilong password={{ lookup(‘password’,’password-liruilong chars=digits length=6 encrypt=sha512_crypt’) }}”192.168.26.82 | CHANGED =>> { “ansible_facts”: { “discovered_interpreter_python”: “/usr/bin/python” }, “changed”: true, “comment”: “”, “create_home”: true, “group”: 1003, “home”: “/home/liruilong”, “name”: “liruilong”, “password”: “NOT_LOGGING_PASSWORD”, “shell”: “/bin/bash”, “state”: “present”, “system”: false, “uid”: 1003}┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$cat password-liruilong747437 salt=Uy3I0UCN┌──[root@vms81.liruilongs.github.io]-[~/ansible]└─$ssh liruilong@192.168.26.82liruilong@192.168.26.82’s password:[liruilong@vms82 ~]$处理liikup错误

大多数 Ansible 插件可在失败时中止 Ansible Playbook,但是,lookup 功能将执行委托给其它插件,这些插件可能不需要在失败时中止 Ansible Playbook。

– name: error demo hosts: 192.168.26.81 tasks: – name: debug demo error debug: var: lookup(‘file’, ‘/etc/passwd’,error=’warn’) | default(“Default file conten”)

lookup 插件接受 error 参数:

本地生成密码远程批量创建用户

$ cat users.txtjonfoojanebarphilbaz$

编写剧本

$ cat site.yml- name: Populate users from file hosts: all gather_facts: no tasks: – name: Create remote user vars: password: “{{ lookup(‘password’, ‘credentials/’ + item + ‘ length=9’) }}” user: name: “{{ item }}” password: “{{ password | password_hash(‘sha512’) }}” update_password: on_create state: present loop: “{{ query(‘lines’,’cat users.txt’) }}”$

$ ansible-playbook site.ymlPLAY [Populate users from file] ******************************************************************************TASK [Create remote user] ************************************************************************************changed: [serverf.lab.example.com] =>> (item=jonfoo)changed: [serverf.lab.example.com] =>> (item=janebar)changed: [serverf.lab.example.com] =>> (item=philbaz)PLAY RECAP ***************************************************************************************************serverf.lab.example.com : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

$ ls credentials/* | xargs cat4qj2fAR6_FrQRx7XR4DgJoh1e7:博文参考

《Red Hat Ansible Engine 2.8 DO447》

好玩下载

问道手游石魔(问道手游石魔和云兽哪个好)

2023-8-10 21:00:05

综合资源

大吉岭?大吉岭面积多大

2024-12-9 16:00:31

购物车
优惠劵
搜索