文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Ansible常用模块使用详解

2024-11-28 15:46

关注

ansible常用模块有:

1)ping

2)yum

3)template

4)copy

5)user

6)group

7)service

8)raw

9)command

10)shell

11)script

12)file

ansible常用模块raw、command、shell的区别:

二、ansible常用模块之ping

ping模块用于检查指定节点机器是否连通 ,用法很简单 ,不涉及参数 ,主机如果在线 ,则回复pong。

具体用法:

[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m ping
192.168.160.137   | SUCCESS  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : false ,
"ping " : "pong "}

三、ansible常用模块之command

command模块用于在远程主机上执行命令 ,ansible默认就是使用command模块。

command模块有一个缺陷就是不能使用管道符和重定向功能。

具体用法:

//查看受控主机的/tmp目录内容
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'ls /tmp '
192.168.160.137   | CHANGED | rc=0  >>
ansible_ansible .legacy .command_payload_5oag98gx vmware- root_912-2697663791

//在受控主机的/tmp目录下新建一个文件test
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'ls /tmp '
192.168.160.137   | CHANGED | rc=0  >>
ansible_ansible .legacy .command_payload_5oag98gx vmware- root_912-2697663791
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'touch /tmp/test ' 192.168.160.137 | CHANGED | rc=0 >>

[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'ls /tmp '
192.168.160.137   | CHANGED | rc=0  >>
ansible_ansible .legacy .command_payload_vr17igqu
test
vmware- root_912-2697663791

//command模块不支持管道符,不支持重定向
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'echo "hello world "> / tmp/test '
192.168.160.137   | CHANGED | rc=0  >>
hello world> /tmp/test
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'cat /tmp/test ' 192.168.160.137 | CHANGED | rc=0 >>

[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'ps -ef|grep vsftpd ' 192.168.160.137 | FAILED | rc=1 >>
error: unsupported SysV option

Usage:
ps [options]

Try 'ps --help  '
or   'ps --help  '
for  additional help text.

For more details see ps (1 ) .non-zero return  code

四、ansible常用模块之raw

raw模块用于在远程主机上执行命令 ,其支持管道符与重定向。

具体用法:

//支持重定向
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m raw -a 'echo "hello wo rld "> /tmp/test '
192.168.160.137   | CHANGED | rc=0  >>
Shared connection to 192 .168 .160 .137  closed.

[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'cat /tmp/test ' 192.168.160.137 | CHANGED | rc=0 >>
hello world

//支持管道符
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m raw -a 'cat /tmp/test| g rep -Eo hello '
192.168.160.137   | CHANGED | rc=0  >>
hello
Shared connection to 192 .168 .160 .137  closed.

五、ansible常用模块之shell

shell模块用于在受控机上执行受控机上的脚本 ,亦可直接在受控机上执行命令。

shell模块亦支持管道与重定向。

具体用法:

//查看受控机上的脚本
[ root@yxt01 ~]# mkdir /scripts
[ root@yxt01 ~]# vim /scripts/test.sh
#!/bin/bash

for  i in  $(seq 10) ;do
echo  $i
done
[ root@yxt01 ~]# chmod +x /scripts/test.sh

//使用shell模块在受控机上执行受控机上的脚本
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m shell -a /scripts/tes t.sh
192.168.160.137 | CHANGED | rc=0 >>
1
2
3
4
5
6
7
8
9
10

六、ansible常用模块之script

script模块用于在受控机上执行主控机上的脚本。

具体用法:

//控制节点编写脚本
[ root@ansible ansible]# mkdir scripts
[ root@ansible ansible]# vim scripts/a .sh
#!/bin/bash

echo  "123456789 "  > /tmp/yxt
[ root@ansible ansible]# chmod +x scripts/a .sh
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m script -a /etc/ansibl e/scripts/a .sh
192.168.160.137 | CHANGED => {
"changed " : true ,
" rc " : 0 ,
"stderr " : "Shared connection to 192 .168 .160 .137 closed.\ r\n " , "stderr_lines " : [
"Shared connection to 192 .168 .160 .137 closed. "
] ,
"stdout " : "" ,
"stdout_lines " : []
}
//查看受控机上的/tmp/yxt文件内容
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'cat /tmp/yxt ' 192.168.160.137 | CHANGED | rc=0 >>123456789

七、ansible常用模块之template

template模块用于生成一个模板 ,并可将其传输至远程主机上。

具体用法:

//将控制节点的源传到受控主机


[ root@ansible ansible]# ansible 192 .168 .160 .137 -m template -a 's rc=/etc/ yum . repos .d/base . repo dest=/etc/yum . repos .d/yxt. repo '
192.168.160.137   | CHANGED => {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"checksum " : "560603bdf5025f4792d05af5c847c331021ce0bd " ,
"dest " : "/etc/yum . repos .d/yxt. repo " ,
"gid " : 0 ,
"group " : " root " ,
"md5sum " : "8c363e0c07338b6ac086feb c52347eec " ,
"mode " : "0644 " ,
"owner " : " root " ,
"size " : 363 ,
"s rc " : "/ root/ .ansible/tmp/ansible-tmp-1666347840 .691359-46642-101169
141864363/source " ,
"state " : "file " ,
"u id " : 0
}
//查看受控机是否传输成功
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'ls /etc/yum . repos .d ' 192.168.160.137 | CHANGED | rc=0 >>yxt. repo

八、ansible常用模块之yum

yum模块用于在指定节点机器上通过yum管理软件 ,其支持的参数主要有两个:

state常用的值:

若想使用yum来管理软件 ,请确保受控机上的yum源无异常。

具体用法:

//在ansible主机上使用yum模块在受控机上安装httpd
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m yum -a 'name=httpd st a te=present '
192.168.160.137   | SUCCESS => {


"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : false ,
"msg " : "Nothing to do " ,
" rc " : 0 ,
" results " : []
}

//查看受控机上是否安装了vsftpd
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m shell -a ' rpm -qa |g rep httpd '
192.168.160.137   | CHANGED | rc=0  >>
centos-logos-httpd-85 .8-2 .el8 .noarch
httpd-tools-2 .4 .37-43 .module_el8 .5 .0+1022+b541f3b1 .x86_64
httpd-filesystem-2 .4 .37-43 .module_el8 .5 .0+1022+b541f3b1 .noarch httpd-2 .4 .37-43 .module_el8 .5 .0+1022+b541f3b1 .x86_64

//安装多个软件包
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m yum -a 'name=httpd ,vi m ,unzip state=present '

九、ansible常用模块之copy

copy模块用于复制文件至远程受控机。

具体用法:

[ root@ansible ansible]# ansible 192 .168 .160 .137 -m copy -a 's rc=/etc/ansi ble/scripts/a .sh dest=/tmp/ '
192.168.160.137 | CHANGED =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"checksum " : "ab84c988002f9a200bb48f94998796fc4ec4f08f " ,
"dest " : "/tmp/a .sh " ,
"gid " : 0 ,
"group " : " root " ,
"md5sum " : "598a8c03922c68043f9a641e9be ba08e " ,
"mode " : "0644 " ,
"owner " : " root " ,
"size " : 41 ,
"s rc " : "/ root/ .ansible/tmp/ansible-tmp-1666350011 .7698014-47306-23315
2996046928/source " ,
"state " : "file " ,
"u id " : 0
}


//查看受控机上的/tmp
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'ls /tmp/ '
192.168.160.137 | CHANGED | rc=0 >>
ansible_ansible .legacy .command_payload_xnu2k8sp a .sh
test
vmware- root_912-2697663791  yxt

十、ansible常用模块之group

group模块用于在受控机上添加或删除组。

具体用法:

//在受控机上添加一个系统组,其gid为306 ,组名为mysql
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m group -a 'name=mysql g id=306 state=present '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"gid " : 306 ,
"name " : "mysql " ,
"state " : "present " ,
"system " : false
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m shell -a 'g rep mysql / etc/group '
192.168.160.137   | CHANGED | rc=0  >>
mysql :x:306:

//删除受控机上的mysql组
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m group -a 'name=mysql s tate=absent '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {


"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"gid " : 306 ,
"name " : "mysql " ,
"state " : "absent " ,
"system " : false
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m shell -a 'g rep mysql / etc/group '
192.168.160.137   | FAILED | rc=1  >>
non-zero return  code

十一、 ansible常用模块之user

user模块用于管理受控机的用户帐号。

具体用法:

//在受控机上添加一个系统用户,用户名为mysql ,u id为306 ,设置其shell为/sbin/nologi n ,无家目录


[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m user -a 'name=mysql ui d=306 system=yes create_home=no shell=/sbin/nologin state=present '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python "
} ,
"changed " :
"comment " :
"create_home " : false ,
"group " : 100 ,
"home " : "/home/mysql " ,
"name " : "mysql " ,
"shell " : "/sbin/nologin " ,
"state " : "present " ,
"system " : true ,
"u id " : 306
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m shell -a 'g rep mysql / etc/passwd '
192.168.160.137   | CHANGED | rc=0  >>
mysql :x:306:100::/home/mysql :/sbin/nologin

[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m shell -a 'ls /home '
192.168.160.137   | CHANGED | rc=0  >>
yexiaotian

//修改mysql用户的u id为366
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m user -a 'name=mysql ui d=366 '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"append " : false ,
"changed " :
"comment " :
"group " : 100 ,
"home " : "/home/mysql " ,
"move_home " : false ,
"name " : "mysql " ,
"shell " : "/sbin/nologin " ,
"state " : "present " ,
"u id " : 366
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m shell -a 'g rep mysql / etc/passwd '
192.168.160.137   | CHANGED | rc=0  >>
mysql :x:366:100::/home/mysql :/sbin/nologin

//删除受控机上的mysql用户
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m user -a 'name=mysql st ate=absent '
true
""
true
""
,
,
,
,


192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"force " : false ,
"name " : "mysql " ,
" remove " : false ,
"state " : "absent "
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m shell -a 'g rep mysql / etc/passwd '
192.168.160.137   | FAILED | rc=1  >>
non-zero return  code

十二、ansible常用模块之service

service模块用于管理受控机上的服务。

具体用法:

//查看受控机上的httpd服务是否启动
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m shell -a 'systemctl is -active httpd '
192.168.160.137   | FAILED | rc=3  >>
inactivenon-zero return  code

//启动受控机上的httpd服务
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m service -a 'name=httpd state=started '
192.168.160.137   | CHANGED => {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,


"name " : "httpd " ,
"state " : "started " ,
"status " : {
"ActiveEnterTimestamp " : " Fri 2022-10-21 19:59:40 CST " ,
"ActiveEnterTimestampMonotonic " : "37169140809 " ,
. . . . .省略

//查看受控机上的httpd服务是否启动
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m shell -a 'systemctl is -active httpd '
192.168.160.137   | CHANGED | rc=0  >>
active

//查看受控机上的httpd服务是否开机自动启动
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m service -a 'name=httpd enabled=yes '
192.168.160.137   | CHANGED => {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"enabled " : true ,
"name " : "httpd " ,
"status " : {
"ActiveEnterTimestamp " : " Fri 2022-10-21 20:01:35 CST " , "ActiveEnterTimestampMonotonic " : "37284140964 " ,
"ActiveExitTimestamp " : " Fri 2022-10-21 19:59:49 CS
. . . . .省略

//查看受控机上的httpd服务是否开机自动启动
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m shell -a 'systemctl is -enabled httpd '
192.168.160.137 | CHANGED | rc=0 >>
enabled

//停止受控机上的httpd服务
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m service -a 'name=httpd state=stopped '
192.168.160.137 | CHANGED => {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"name " : "httpd " ,
"state " : "stopped " ,
"status " : {
"ActiveEnterTimestamp " : " Fri 2022-10-21  20:01:35  CST " ,
"ActiveEnterTimestampMonotonic " : "37284140964 " ,
. . . . .省略
[ root@ansible ansible]# ansible 192 .168 .160 .137 -m shell -a 'systemctl is -active httpd '
192.168.160.137 | FAILED | rc=3 >>


inactivenon-zero return code
[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'ss -anlt ' 192.168.160.137 | CHANGED | rc=0 >>
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0 .0 .0 .0:22 0 .0 .0 .0:*LISTEN 0 128 [ ::] :22 [ ::] :*

十三、ansible常用模块之file

file 模块可以帮助我们完成一些对文件的基本操作。

具体用法:

//在远程主机上创建一个名为 data 的目录
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m file -a 'path=/ root/da ta state=directory '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,


"changed " : true ,
"gid " : 0 ,
"group " : " root " ,
"mode " : "0755 " ,
"owner " : " root " ,
"path " : "/ root/data " ,
"size " : 6 ,
"state " : "directory " ,
"u id " : 0
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -a 'ls -l /root ' 192.168.160.137   | CHANGED | rc=0  >>
total 0
drwxr-xr-x 2  root root 6  Oct 21  20:17  data

//在远程主机上创建一个名为abc 的文件
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m file -a 'path=/ root/ab c state=touch '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"dest " : "/ root/abc " ,
"gid " : 0 ,
"group " : " root " ,
"mode " : "0644 " ,
"owner " : " root " ,
"size " : 0 ,
"state " : "file " ,
"u id " : 0
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -a 'ls -l /root ' 192.168.160.137   | CHANGED | rc=0  >>
total 0
- rw- r-- r-- 1  root root 0  Oct 21  20:21  abc
drwxr-xr-x 2  root root 6  Oct 21  20:17  data

//在远程主机上为abc文件创建软链接文件,软链接名为 1 .link
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m file -a 'path=/ root/1 . link state=link s rc=/ root/abc '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"dest " : "/ root/1 .link " ,
"gid " : 0 ,
"group " : " root " ,
"mode " : "0777 " ,
"owner " : " root " ,
"size " : 9 ,

"s rc " : "/ root/abc " ,
"state " : "link " ,
"u id " : 0
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -a 'ls -l /root '


192.168.160.137   |
total 0
l rwx rwx rwx 1  root - rw- r-- r-- 1  root drwxr-xr-x 2  root

CHANGED | rc=0  >>

root 9  Oct 21  20:23 root 0  Oct 21  20:21 root 6  Oct 21  20:17



1 .link -> / root/abc
abc
data


//在远程主机上上为 abc文件创建硬链接文件,硬链接名为 1 .hard
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m file -a 'path=/ root/1 . hard state=hard s rc=/ root/abc '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"dest " : "/ root/1 .hard " ,
"gid " : 0 ,
"group " : " root " ,
"mode " : "0644 " ,
"owner " : " root " ,
"size " : 0 ,
"s rc " : "/ root/abc " ,
"state " : "hard " ,
"u id " : 0
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -a 'ls -l /root '


192.168.160.137   |
total 0
- rw- r-- r--
2
1
2
2
root root root root
l rwx rwx rwx
- rw- r-- r--
drwxr-xr-x

CHANGED | rc=0  >>

root 0  Oct 21  20:21 root 9  Oct 21  20:23 root 0  Oct 21  20:21 root 6  Oct 21  20:17



1 .hard
1 .link -> / root/abc
abcdata

注意:在创建链接文件时,如果源文件不存在,或者链接文件与其他文件同名时,强制覆盖同名文件或者创建链接文件。

//删除远程机器上的指定文件或目录
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m file -a 'path=/ root/da ta state=absent '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"path " : "/ root/data " ,
"state " : "absent "
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -a 'ls -l /root '



192.168.160.137   | total 0
- rw- r-- r-- 2  root l rwx rwx rwx 1  root - rw- r-- r-- 2  root

CHANGED | rc=0  >>

root 0  Oct 21  20:21 root 9  Oct 21  20:23 root 0  Oct 21  20:21



1 .hard
1 .link -> / root/abc
abc


// 在创建文件或目录的时候指定属主,或者修改远程主机上的文件或目录的属主
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m file -a 'path=/ root/ab c state=touch owner=yexiaotian group=apache '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"dest " : "/ root/abc " ,
"gid " : 48 ,
"group " : "apache " ,
"mode " : "0644 " ,
"owner " : "yexiaotian " ,
"size " : 0 ,
"state " : "hard " ,
"u id " : 4000
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -a 'ls -l /root '
192.168.160.137   | CHANGED | rc=0  >>
total 0
- rw- r-- r-- 2  yexiaotian apache 0  Oct 21  20:30  1 .hard
l rwx rwx rwx 1  root root 9  Oct 21  20:23  1 .link -> / root/abc
- rw- r-- r-- 2  yexiaotian apache 0  Oct 21  20:30  abc

//在创建文件或目录的时候指定权限,或者修改远程主机上的文件或目录的权限
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -m file -a 'path=/ root/ab c state=touch mode=755 '
192.168.160.137   | CHANGED  =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
"dest " : "/ root/abc " ,
"gid " : 48 ,
"group " : "apache " ,
"mode " : "0755 " ,
"owner " : "yexiaotian " ,
"size " : 0 ,
"state " : "hard " ,
"u id " : 4000
}
[ root@ansible  ansible]# ansible 192 .168 .160 .137  -a 'ls -l /root ' 192.168.160.137   | CHANGED | rc=0  >>
total 0
- rwxr-xr-x 2  yexiaotian apache 0  Oct 21  20:31  1 .hard
l rwx rwx rwx 1  root root 9  Oct 21  20:23  1 .link -> / root/abc


- rwxr-xr-x 2  yexiaotian apache 0  Oct 21  20:31  abc

十四、扩展模块之 yum_repository模块**

yum_repository 模块可以帮助我们管理远程主机上的yum仓库。

具体用法:

[ root@ansible ansible]# ansible 192 .168 .160 .137 -m yum_ repository -a 'fil e=yxt. repo name= "BaseOS " description=BaseOS baseurl= "http://mirrors .aliyu n .com/centos-vault/8 .5 .2111/BaseOS/$basearch/os/ " gpgcheck=no enabled=ye s '
192.168.160.137 | CHANGED =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
" repo " : "BaseOS " ,
"state " : "present "
}

[ root@ansible ansible]# ansible 192 .168 .160 .137 -m yum_ repository -a 'fil e=yxt. repo name= "AppStream " description=AppStream baseurl= "http://mirror s .aliyun .com/centos-vault/8 .5 .2111/AppStream/$basearch/os/ " gpgcheck=no e nabled=yes '
192.168.160.137 | CHANGED =>  {
"ansible_facts " : {
"discovered_interpreter_python " : "/us r/libexec/platform-python " } ,
"changed " : true ,
" repo " : "AppStream " ,
"state " : "present "
}

[ root@ansible ansible]# ansible 192 .168 .160 .137 -a 'cat /etc/yum . repos .d/ yxt. repo . repo '
192.168.160.137 | CHANGED | rc=0 >>
[BaseOS]
async = 1
baseurl = http://mirrors .aliyun .com/centos-vault/8 .5 .2111/BaseOS/$basearc
h/os/
enabled = 1
gpgcheck = 0
name = BaseOS

[AppStream]
async = 1
baseurl = http://mirrors .aliyun .com/centos-vault/8 .5 .2111/AppStream/$base arch/os/
enabled = 1
gpgcheck = 0
name = AppStream


来源:IT那活儿内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯