[root@servera /]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.1 (Ootpa) [root@servera /]# uname -a Linux servera.lab.example.com 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Tue Jan 14 15:50:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux [root@servera /]#
[root@servera /]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:00:fa:0a brd ff:ff:ff:ff:ff:ff inet 172.25.250.10/24 brd 172.25.250.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 fe80::984:87d2:dba7:1007/64 scope link noprefixroute valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:01:fa:0a brd ff:ff:ff:ff:ff:ff inet 192.168.0.10/24 brd 192.168.0.255 scope global noprefixroute eth1 valid_lft forever preferred_lft forever inet6 fe80::d932:da41:591c:5c89/64 scope link noprefixroute valid_lft forever preferred_lft forever 4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:02:fa:0a brd ff:ff:ff:ff:ff:ff [root@servera /]#
使⽤ ansible-galaxy 命令验证系统⻆⾊是否可⽤。
1 2 3 4
[student@workstation netlink-automation]$ ansible-galaxy list # /usr/share/ansible/roles # /etc/ansible/roles [WARNING]: - the configured path /home/student/.ansible/roles does not exist.
如果没有⻆⾊可⽤,请安装 rhel-system-roles 软件包。
1 2 3 4 5 6 7 8 9 10 11 12
[student@workstation netlink-automation]$ sudo yum -y install rhel-system-roles [sudo] password for student: Last metadata expiration check: 0:25:21 ago on Wed Jun 29 21:38:42 2022. Dependencies resolved. ===================================================================================================== Package Architecture Version Repository Size ===================================================================================================== Installing: rhel-system-roles noarch 1.0-9.el8 rhel-8.1-for-x86_64-appstream-rpms 174 k