Ansible之系列命令详解

更新时间:2023-07-29 02:14:44 阅读: 评论:0

Ansible之系列命令详解
  ansible系列命令有:ansible、ansible-doc、ansible-playbook、ansible-vault、ansible-console、ansible-galaxy、ansible-pull,这些命令每个命令都有它独特的作⽤和⽤法,接下来我们⼀⼀来了解它的⽤法。
1、ansible-doc:这个命令主要作⽤是显⽰模块的帮助信息,有点类似Linux⾥的man命令。
命令⽤法:
ansible-doc [options] []
常⽤选项:
  -a:显⽰所有模块的⽂档
[root@localhost ~]# ansible-doc -a ping
> A10_SERVER    (/usr/lib/python2.7/site-packages/ansible/modules/network/a10/a10_rver.py)
Manage SLB (Server Load Balancer) rver objects on A10 Networks devices via aXAPIv2.
OPTIONS (= is mandatory):
= host
Hostname or IP of the A10 Networks device.
[Default: None]
- partition
t active-partition
[Default: None]
version_added: 2.3
= password
Password for the `urname' account.
(Alias: pass, pwd)[Default: None]
-
rver_ip
The SLB rver IPv4 address.
(Alias: ip, address)[Default: None]
:
  说明:-a选项列出了ping模块的所有⽤法,以上只显⽰了部分。
  -l,--list列出全部可以模块
[root@localhost ~]# ansible-doc -l
a10_rver                                Manage A10 Networks AX/SoftAX/Thunder/vThunder devices' rver object.
a10_rver_axapi3                        Manage A10 Networks AX/SoftAX/Thunder/vThunder devices
a10_rvice_group                        Manage A10 Networks AX/SoftAX/Thunder/vThunder devices' rvice groups.
a10_virtual_rver                        Manage A10 Networks AX/SoftAX/Thunder/vThunder devices' virtual rvers.
accelerate                                Enable accelerated mode on remote node
aci_aep                                  Manage attachable Access Entity Profile (AEP) on Cisco ACI fabrics (
aci_ap                                    Manage top level Application Profile (AP) objects on Cisco ACI fabrics (...
aci_bd                                    Manage Bridge Domains (BD) on Cisco ACI Fabrics (fv:BD)
aci_bd_subnet                            Manage Subnets on Cisco ACI fabrics (fv:Subnet)
aci_bd_to_l3out                          Bind Bridge Domain to L3 Out on Cisco ACI fabrics (fv:RsBDToOut)
aci_config_rollback                      Provides rollback and rollback preview functionality for Cisco
aci_config_snapshot                      Manage Config Snapshots on Cisco ACI fabrics (config:Snapshot,
aci_contract                              Manage contract resources on Cisco ACI fabrics (vz:BrCP)
aci_contract_subject                      Manage initial Contract Subjects on Cisco ACI fabrics (vz:Subj)
aci_contract_subject_to_filter            Bind Contract Subjects to Filters on Cisco ACI fabrics (
aci_epg                                  Manage End Point Groups (EPG) on Cisco ACI fabrics (fv:AEPg)
aci_epg_monitoring_policy                Manage monitoring policies on Cisco ACI fabrics (mon:EPGPol)
aci_epg_to_contract                      Bind EPGs to Contracts on Cisco ACI fabrics (fv:RsCons and fv:RsProv)
aci_epg_to_domain                        Bind EPGs to Domains on Cisco ACI fabrics (fv:RsDomAtt)
aci_filter                                Manages top level filter objects on Cisco ACI fabrics (vz:Filter)
aci_filter_entry                          Manage filter entries on Cisco ACI fabrics (vz:Entry)
aci_intf_policy_fc                        Manage Fibre Channel interface policies on Cisco ACI fabrics (fc:IfPol)
aci_intf_policy_l2                        Manage Layer 2 interface policies on Cisco ACI fabrics (l2:IfPol)
:
  说明:-l选项列出了所有可⽤模块,并简要说明了模块主要功能,以上内容只显⽰了部分
  -s,--snippet显⽰指定模块的playbook⽚段
[root@localhost ~]# ansible-doc -s ping
- name: Try to connect to host, verify a usable python and return `pong' on success
ping:
data:                  # Data to return for the `ping' return value. If this parameter is t to `crash', the
module will cau an exception.
[root@localhost ~]#
间怎么组词  说明:-s这个选项是我们常⽤的选项,它主要列出模块的常⽤参数的使⽤和参数的作⽤。
2、ansible:这个命令就是ansible的主程序,我们经常⽤这个命令来管理主机,它可以调⽤各种模块对远端主机进⾏配置管理、应⽤部署、任务执⾏等功能。前⽂我们介绍了ansible有两种⽅式管理主机,⼀种是ad-hoc,也就是在命令⾏⽤ansible这个命令来管理主机,还有⼀种⽅式就是⽤ansible-playbook。
命令⽤法:
ansible <host-pattern> [-m module_name] [-a args]
  说明:它的⽤法还是很好理解,我们都知道ansible的强⼤之处是它有很多模块,ansible命令管理主机就是利⽤这些模块去管理主机的,以上⽤法就是说⽤ansible管理哪些主机(我们需要指定主机或主机组),⽤什么模块(表现形式 -m指定模块名称,若不指定则表⽰使⽤默认模块),让模块⼲什么事(它的表现形式就是-a 指定给模块传递相应的参数)
常⽤选项:
  --version:显⽰版本
[root@localhost ~]# ansible --version
ansible 2.4.2.0
config file = /etc/ansible/ansible.cfg
configured module arch path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
[root@localhost ~]#
  -m  module:指定模块,才安装好ansible软件默认的模块是command
  -v :显⽰简要的执⾏过程,-vv显⽰较为详细的过程,-vvv显⽰更为详细的执⾏过程
  --list-hostss:显⽰主机列表,可以简写 --list
[root@localhost ~]# ansible all --list
192.168.0.128
[root@localhost ~]# ansible webrs --list
hosts (1):
192.168.0.99
[root@localhost ~]# ansible apprs --list
hosts (2):
192.168.0.218
192.168.0.128
[root@localhost ~]#
  说明:all 表⽰匹配主机列表中的所有主机
  -k,--ask-pass:指定输⼊ssh连接密码,默认ansible是基于ssh key验证的(k是⼩写的)
[root@localhost ~]# ansible webrs -m ping -k
SSH password:
192.168.0.99 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
[root@localhost ~]#
  说明:这个选项⼀般⽤于我们主机列表中没有做ssh key验证的主机,通常不建议使⽤。
  -K,--ask-become-pass提⽰输⼊sudo时的⼝令(k是⼤写的)
[root@localhost ~]# ansible webrs  -u 'qiuhom' -k -s -K  -a " getent shadow qiuhom"
[DEPRECATION WARNING]: The sudo command line option has been deprecated in favor of the "become" command line
arguments. This feature will be removed in version 2.6. Deprecation warnings can be disabled by tting
deprecation_warnings=Fal in ansible.cfg.
SSH password:
SUDO password[defaults to SSH password]:
192.168.0.99 | SUCCESS | rc=0 >>
qiuhom:$6$5mlfZaKT$YmDjmEnKPoC.xASTVA5JqUrTiIkuXOe1yDm9PCql89e4lGKUS.W1515phi1OgD1W7Zu6Lm9srTBHi9QAigWpz/:18068:0:99999:7:::
[root@localhost ~]#
  说明:-u是指定远程以那个⽤户执⾏,-s 表⽰使⽤sudo运⾏后⾯的操作,-k(⼩写)指定⽤ssh⼝令验证,-K(⼤写)提⽰输⼊sudo时的⼝令,-a 指定给模块传递的参数,上⾯⽰例没有写-m指定的模块就是⽤的默认模块command,当然这个默认模块我们可以在/etc/ansible/ansible.cfg⾥指定
  -C,--check 检查,并不执⾏,这个参数主要⽤于检查playbook是否写的正确。
  -T,--timeout指定执⾏命令的超时时间,默认是10S
  -u,指定以那个⽤户远程执⾏命令,指定的⽤户是远端服务器上存在的。并⾮本地管理端的⽤户
  -b,--become代替旧版的sudo切换
  --become-ur-USERNAME指定sudo的runas⽤户,默认是root
了解了ansible的基本选项说明,接下来我们来说说匹配主机列表
  1、all:表⽰匹配所有定义在主机清单中的主机
[root@localhost ~]# ansible all -m ping
192.168.0.99 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
192.168.0.128 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
192.168.0.218 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
[root@localhost ~]# ansible all --list
hosts (3):
192.168.0.99
192.168.0.218
192.168.0.128
[root@localhost ~]#
  2、“*”:通配符,也可表⽰匹配所有主机清单中的主机,它的⽤法和Linux⾥的通配符类似。
[root@localhost ~]# ansible * -m ping
192.168.0.128 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
192.168.0.218 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
192.168.0.99 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
[root@localhost ~]# ansible 192.168.0.1* -m ping
192.168.0.128 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
[root@localhost ~]# ansible web* -m ping
192.168.0.99 | SUCCESS => {
"changed": fal,
"ping": "pong"
}
[root@localhost ~]#
  3、或关系
[root@localhost ~]# tail -6 /etc/ansible/hosts
[webrs]
192.168.0.99:41319
192.168.0.218
[apprs]
192.168.0.218
192.168.0.128
[root@localhost ~]# ansible "webrs:apprs" --list
hosts (3):
192.168.0.99
192.168.0.218
192.168.0.128
家庭用英语怎么写
[root@localhost ~]# ansible "192.168.0.1*:192.168.0.2*" --list
hosts (2):
  4、逻辑与
[root@localhost ~]# ansible "webrs:&apprs" --list
hosts (1):
192.168.0.218
[root@localhost ~]#
  说明:以上命令的意思是列出在webrs组中,并且⼜在apprs组的主机
  5、逻辑⾮
[root@localhost ~]# ansible "webrs:!apprs" --list
-bash: !apprs": event not found
[root@localhost ~]# ansible 'webrs:!apprs' --list
hosts (1):
192.168.0.99
学前教育的价值
[root@localhost ~]#
  说明:这⾥需要注意⼀点的是逻辑⾮要⽤单引号,以上命令表达的意思是列出在webrs组中,但是不在apprs组中的主机
  6、综合逻辑
[root@localhost ~]# tail -13 /etc/ansible/hosts
[webrs]
192.168.0.99:41319
192.168.0.218
[apprs]
192.168.0.218
192.168.0.128
[dbrs]
192.168.0.208
192.168.0.199
[ftprs]
192.168.0.123
192.168.0.233
[root@localhost ~]#  ansible 'dbrs:webrs:&apprs:!ftprs' --list
hosts (1):
192.168.0.218
[root@localhost ~]#
  说明:以上命令有逻辑或逻辑与逻辑⾮,在这种综合的匹配模式中我们要遵循这样⼀个优先级顺序来匹配,⾸先逻辑⾮的优先级最好,其次是逻辑与,优先级最低是逻辑
或,以上命令表⽰匹配dbrs和webrs两个组中的主机,在apprs中档不在ftprs中的主机
  7、正则表达式
[root@localhost ~]# ansible "~(web|db).*" --list
hosts (4):
192.168.0.99
192.168.0.218
192.168.0.208
192.168.0.199
[root@localhost ~]#
  说明:以上命令表⽰匹配web开头的组或者db开头的组中的主机,~表⽰使⽤正则匹配
了解了ansible的主机列表匹配,接着我们再说下ansible命令的执⾏过程,我们在使⽤ansible执⾏命令的时候可以⽤-vvv选项来显⽰更为详细的执⾏过程
[root@localhost ~]# ansible "webrs:&apprs" -m shell -a "getent passwd root" -vvv
ansible 2.4.2.0
config file = /etc/ansible/ansible.cfg
configured module arch path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
Using /etc/ansible/ansible.cfg as config file
Pard /etc/ansible/hosts inventory source with ini plugin
META: ran handlers
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
<192.168.0.218> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.218> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbad,publickey -o PasswordAuthentication=no -o ConnectTim <192.168.0.218> (0, '/root\n', '')
<192.168.0.218> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.218> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbad,publickey -o PasswordAuthentication=no -o ConnectTim <192.168.0.218> (0, 'ansible-tmp-1573399527.3-188437527440745=/root/.ansible/tmp/ansible-tmp-1573399527.3-188437527440745\n', '')
<192.168.0.218> PUT /tmp/tmpPczCAu TO /root/.ansible/tmp/ansible-tmp-1573399527.3-188437527440745/command.py
<192.168.0.218> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdIntera
ctiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbad,publickey -o PasswordAuthentication=no -o Connec <192.168.0.218> (0, 'sftp> put /tmp/tmpPczCAu /root/.ansible/tmp/ansible-tmp-1573399527.3-188437527440745/command.py\n', '')
<192.168.0.218> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.218> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbad,publickey -o PasswordAuthentication=no -o ConnectTim <192.168.0.218> (0, '', '')
<192.168.0.218> ESTABLISH SSH CONNECTION FOR USER: None
<192.168.0.218> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbad,publickey -o PasswordAuthentication=no -o ConnectTim <192.168.0.218> (0, '\r\n{"changed": true, "end": "2019-11-10 23:25:23.100262", "stdout": "root:x:0:0:root:/root:/bin/bash", "cmd": "getent passwd root", "rc": 0, "start": "2019-11-10 23:25:23.082719", "stderr": "", "delta": "0:00:00.017543", "invocat 192.168.0.218 | SUCCESS | rc=0 >>
root:x:0:0:root:/root:/bin/bash
META: ran handlers
META: ran handlers
[root@localhost ~]#
  说明:通过以上信息的查看,我们可以⼤概知道ansible的执⾏命令的过程,如下
  1、⾸先ansible会加载⾃⼰的配置⽂件,默认是/etc/ansible/ansible.cfg
  2、加载对应模块⽂件,如上就是加载的是shell模块
  3、通过ansible将模块或命令⽣成对应的python临时⽂件,并将该⽂件⽤sftp传输⾄远端主机的对应执⾏⽤户的家⽬录下的.ansible/tmp/ansible-tmp-数字/xxxx.py⽂件
  4、然后对刚才传送过去的临时⽂件加可执⾏权限 chmod + x
  5、执⾏临时⽂件,并返回结果
  6、删除临时py⽂件,sleep 0 退出
ansible的返回结果⼀般会有3种颜⾊来表⽰执⾏结果:红⾊,绿⾊,橘黄⾊。其中红⾊表⽰执⾏失败,或者执⾏过程中有异常,⼀般会终⽌剩余的所有任务。绿⾊和橘黄⾊表⽰贤淑哥
执⾏过程中没有异常,所有任务均正常执⾏,但橘黄⾊表⽰命令执⾏结束后⽬标有状态变化,⽽绿⾊表⽰命令执⾏后⽬标没有状态变化,不仅ansible命令执⾏结果有如此设
置,ansible系列命令均有此设置,所以判断ansible系列命令的执⾏结果是否正常,我们看颜⾊即可
3、ansible-galaxy:命令主要作⽤是连接下载/上传相应的roles
命令⽤法:
Usage: ansible-galaxy [delete|import|info|init|install|list|login|remove|arch|tup] [--help] [options] ...
[root@localhost ~]# ansible-galaxy dis
- downloading role 'redis', owned by geerlingguy
- downloading role /geerlingguy/ansible-role-redis/archive/1.6.
-
dis to /etc/ansible/dis
- dis (1.6.0) was installed successfully
[root@localhost ~]#
  2、列出所有已经安装的⾓⾊列表
[root@localhost ~]# ansible-galaxy list
- dis, 1.6.0
[root@localhost ~]#
  3、删除已安装的⾓⾊
[root@localhost ~]# ansible-galaxy dis
- successfully dis
[root@localhost ~]# ansible-galaxy list
[root@localhost ~]#
  说明:galaxy默认下载到/etc/ansible/roles⽬录下,我们删除也可直接删除该⽬录下的⾓⾊,当然我们也可把⾃⼰写好的⾓⾊放在该⽬录下,⽤ansible-galaxy list 也是可以查看到我们⾃⼰写的⾓⾊。
4、ansible-vault:命令主要功能管理机密解密yaml⽂件
命令⽤法:
Usage: ansible-vault [create|decrypt|edit|encrypt|encrypt_string|rekey|view] [options] [l]
  1、加密
[root@localhost ansible]# cat test.yaml
---
- hosts: webrs
remote_ur: root
tasks:
- name: test
command: hostname巩字组词
[root@localhost ansible]# ansible-vault encrypt test.yaml
New Vault password:
Confirm New Vault password:
Encryption successful
[root@localhost ansible]# cat test.yaml
$ANSIBLE_VAULT;1.1;AES256
38653234373532306537633636343038383031613537303437623730626462306665363165363432
6162306332313031326330386136623464346533363164320a353734386632303837393633643932 62656262626265396236646536646231646631363431383261623530626639303132396139633731
6663633466373034320a323161316262653535353361353436353238663836623034366534393265 34663862363938653531346237323265633861663430313839653932633362333865333366353765 38326239386432373665396133346632346336373839386134366335663339363338306138363733 39653462373564383736373063333764653137356237353563396635633862623039373964326531 61626138316239663535346562643436666534333637313363663536393932313565623533666561
6564
[root@localhost ansible]#
  2、解密
[root@localhost ansible]# cat test.yaml
$ANSIBLE_VAULT;1.1;AES256
38653234373532306537633636343038383031613537303437623730626462306665363165363432
6162306332313031326330386136623464346533363164320a353734386632303837393633643932 62656262626265396236646536646231646631363431383261623530626639303132396139633731
6663633466373034320a323161316262653535353361353436353238663836623034366534393265 34663862363938653531346237323265633861663430313839653932633362333865333366353765 38326239386432373665396133346632346336373839386134366335663339363338306138363733 39653462373564383736373063333764653137356237353563396635633862623039373964326531 61626138316239663535346562643436666534333637313363663536393932313565623533666561
6564
[root@localhost ansible]# ansible-vault decrypt test.yaml
Vault password:
Decryption successful
[root@localhost ansible]# cat test.yaml
---
- hosts: webrs
remote_ur: root
tasks:
- name: test
command: hostname
[root@localhost ansible]#
  3、不解密查看
[root@localhost ansible]# cat test.yaml
$ANSIBLE_VAULT;1.1;AES256
63623938346561623733663938396234303933353162326531353230366237373664663662623133
3136653066363866363461666438346531626439346134660a623231326637336464303965366263 38353637633962326233313664353966343663393931393131303361323139646530333566313739
3233336166653038630a626637366661646638376338653261373336373438353639333930363836 32353464313438633632323366323731333830326632313837623131636363393664323863663437
38346131303561373865316666346265653039346333373663383861653737373466356466393439 35386163636234623564353537373264636138636663663531356164313437373164633433303635 63306439633963636136663637643936373337376130616433396561303535313330656337323233
健脾汤3065
[root@localhost ansible]# ansible-vault view test.yaml
Vault password:
---
- hosts: webrs
remote_ur: root
tasks:
- name: test
command: hostname
[root@localhost ansible]# cat test.yaml
$ANSIBLE_VAULT;1.1;AES256
63623938346561623733663938396234303933353162326531353230366237373664663662623133
3136653066363866363461666438346531626439346134660a623231326637336464303965366263 38353637633962326233313664353966343663393931393131303361323139646530333566313739
3233336166653038630a626637366661646638376338653261373336373438353639333930363836 32353464313438633632323366323731333830326632313837623131636363393664323863663437 38346131303561373865316666346265653039346333373663383861653737373466356466393439 35386163636234623564353537373264636138636663663531356164313437373164633433303635 63306439633963636136663637643936373337376130616433396561303535313330656337323233
3065
[root@localhost ansible]#
  4、编辑加密⽂件
63623938346561623733663938396234303933353162326531353230366237373664663662623133 3136653066363866363461666438346531626439346134660a623231326637336464303965366263 38353637633962326233313664353966343663393931393131303361323139646530333566313739
3233336166653038630a626637366661646638376338653261373336373438353639333930363836 32353464313438633632323366323731333830326632313837623131636363393664323863663437 38346131303561373865316666346265653039346333373663383861653737373466356466393439 35386163636234623564353537373264636138636663663531356164313437373164633433303635 63306439633963636136663637643936373337376130616433396561303535313330656337323233
3065
[root@localhost ansible]# ansible-vault edit test.yaml
Vault password:
红烧牛排骨---
- hosts: webrs
remote_ur: root
tasks:
- name: test
command: hostname
- name: test1
shell: ls /root/
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/tmp/tmpBHavml.yaml" 9L, 135C written
[root@localhost ansible]# cat test.yaml
$ANSIBLE_VAULT;1.1;AES256
30653764326466326131636362363762356362393334383966303433306331316335373732633463
3430383065336336333232303933356161363861376335630a363837363963386265333866643265 35333133393861646662636261653662313864633866373930306664646563343966366239373432
3661376233383766610a306366633964343434313533333065623739313762326561303837666437 61623136303764326138643362653166633138653237383761323665393132656161663639353631 62333063323135623466386333633835346539653463656239393562616164656664353562316163 36373161326261336338613137386636653431336535376338313165343564616531653439333764 65653834333335346531316137663332643963323966373064653664656532343061326234373563 31636364663737376639336531313937363630306232613561373932306432623835663563643463 66366530396536373031613134326464623939396538383335633764363237653064656135373262
306462316363333863393765323932373737
[root@localhost ansible]#
  说明:这种编辑好的⽂件还是处于加密状态
  5、修改加密⼝令
[root@localhost ansible]# ansible-vault rekey test.yaml
Vault password:
New Vault password:
Confirm New Vault password:
Rekey successful
[root@localhost ansible]#
  说明:修改⼝令必须先输⼊原⼝令,正确后才可以修改,如果忘记密码则⽂件就⽆法查看,也⽆法修改⼝令
  6、创建新加密⽂件
[root@localhost ansible]# ls
test.yaml
[root@localhost ansible]# ansible-vault create test2.yaml
New Vault password:
Confirm New Vault password:
---
- hosts: apprs
remote_ur: root
tasks:
- name: test2
shell: getent passwd
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/tmp/tmpgYTB3x.yaml" 7L, 92C written
[root@localhost ansible]# ls
test2.yaml  test.yaml
[root@localhost ansible]# cat test2.yaml
$ANSIBLE_VAULT;1.1;AES256
64616164373236646635383539366661646262383936613533363263303136393031633533373638 6261613964636466656439656464336635323337643632620a366133383633633837363432326138 63323331346437636365353866656233363139633364353833623933353732323038336364376539
3963643939383734350a643734356432663063383066313932333837323631636536613834333232 30393464376230633762663364333330343132386132343861636665343831653863653939356536 62333564303934303138356332376634313535373037663866323038363237323438633464623534 61303937313930363230353165346337393462666131303861646262333830333365393737326365 63346431613736303963346130363464313239646361653830303862333236303939613665383261
3230
[root@localhost ansible]
世界奇观5、ansible-console:可交互式执⾏ansible命令,⽀持tab补全,常⽤于ad-hoc和ansible-playbook之间的场景,常⽤于集中⼀批临时操作或命令。[root@localhost ansible]# ansible-console
Vault password:
Welcome to the ansible console.
Type help or ? to list commands.
root@all (7)[f:5]$ list
192.168.0.99
192.168.0.218

本文发布于:2023-07-29 02:14:44,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1122210.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:命令   模块   指定
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图