|
用vim写剧本,要在该用户家目录下创建一个隐含文件.vimrc:
- autocmd FileType yaml setlocal ai ts=2 sw=2 et
复制代码
- ---
- - name: Create User Devops
- hosts: srvgroup
- tasks:
- - name: Create Group:sharedgroup
- group:
- name: sharedgroup
- gid: 6000
- - name: Create User:devops
- user:
- name: devops
- uid: 4000
- group: sharedgroup
复制代码
ansible对于受管节点,有一普查操作:
- student@classroom ansible]$ ansible server1.example.com -m setup
- server1.example.com | SUCCESS => {
- "ansible_facts": {
- "ansible_all_ipv4_addresses": [
- "192.168.122.1",
- "192.168.0.101"
- ],
- "ansible_all_ipv6_addresses": [
- "fe80::5054:ff:fefb:e6e2"
- ],
- "ansible_apparmor": {
- "status": "disabled"
- },
- "ansible_architecture": "x86_64",
- "ansible_bios_date": "04/01/2014",
- "ansible_bios_version": "1.11.1-3.module+el8+2529+a9686a4d",
- "ansible_cmdline": {
- "BOOT_IMAGE": "(hd0,msdos1)/vmlinuz-4.18.0-80.el8.x86_64",
- "crashkernel": "auto",
- "quiet": true,
- "rd.lvm.lv": "RAC12crhel7/root",
- "resume": "UUID=c1e4f499-e2be-44d5-b649-10a40f484de5",
- "rhgb": true,
- "ro": true,
- "root": "/dev/mapper/RAC12crhel7-root"
- },
- "ansible_date_time": {
- "date": "2020-08-05",
- "day": "05",
- "epoch": "1596631546",
- "hour": "20",
- "iso8601": "2020-08-05T12:45:46Z",
- "iso8601_basic": "20200805T204546457512",
- "iso8601_basic_short": "20200805T204546",
- "iso8601_micro": "2020-08-05T12:45:46.457692Z",
- "minute": "45",
- "month": "08",
- "second": "46",
- "time": "20:45:46",
- "tz": "CST",
- "tz_offset": "+0800",
- "weekday": "Wednesday",
- "weekday_number": "3",
- "weeknumber": "31",
- "year": "2020"
- },
- "ansible_default_ipv4": {
- "address": "192.168.0.101",
- "alias": "enp1s0",
- "broadcast": "192.168.0.255",
- "gateway": "192.168.0.254",
- "interface": "enp1s0",
- "macaddress": "52:54:00:fb:e6:e2",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "network": "192.168.0.0",
- "type": "ether"
- },
- "ansible_default_ipv6": {},
- "ansible_device_links": {
- "ids": {
- "dm-0": [
- "dm-name-RAC12crhel7-root",
- "dm-uuid-LVM-nHdecfJXprePDREWmyX4Adefv49jjhoeYcQtGP9blRP0GnUUjeJUxcDYlsZJw3lK"
- ],
- "vda2": [
- "lvm-pv-uuid-Rcem3W-eXgv-1pPY-Awjb-qlxZ-28dd-a0gjBe"
- ]
- },
- "labels": {},
- "masters": {
- "vda2": [
- "dm-0"
- ]
- },
- "uuids": {
- "dm-0": [
- "0ccf2fb6-16c6-4467-9dcf-6d68857b6339"
- ],
- "vda1": [
- "c392dc14-3544-4194-835b-79442df21476"
- ],
- "vda3": [
- "c1e4f499-e2be-44d5-b649-10a40f484de5"
- ]
- }
- },
- "ansible_devices": {
- "dm-0": {
- "holders": [],
- "host": "",
- "links": {
- "ids": [
- "dm-name-RAC12crhel7-root",
- "dm-uuid-LVM-nHdecfJXprePDREWmyX4Adefv49jjhoeYcQtGP9blRP0GnUUjeJUxcDYlsZJw3lK"
- ],
- "labels": [],
- "masters": [],
- "uuids": [
- "0ccf2fb6-16c6-4467-9dcf-6d68857b6339"
- ]
- },
- "model": null,
- "partitions": {},
- "removable": "0",
- "rotational": "1",
- "sas_address": null,
- "sas_device_handle": null,
- "scheduler_mode": "",
- "sectors": "37683200",
- "sectorsize": "512",
- "size": "17.97 GB",
- "support_discard": "0",
- "vendor": null,
- "virtual": 1
- },
- "vda": {
- "holders": [],
- "host": "SCSI storage controller: Red Hat, Inc. Virtio block device (rev 01)",
- "links": {
- "ids": [],
- "labels": [],
- "masters": [],
- "uuids": []
- },
- "model": null,
- "partitions": {
- "vda1": {
- "holders": [],
- "links": {
- "ids": [],
- "labels": [],
- "masters": [],
- "uuids": [
- "c392dc14-3544-4194-835b-79442df21476"
- ]
- },
- "sectors": "614400",
- "sectorsize": 512,
- "size": "300.00 MB",
- "start": "2048",
- "uuid": "c392dc14-3544-4194-835b-79442df21476"
- },
- "vda2": {
- "holders": [
- "RAC12crhel7-root"
- ],
- "links": {
- "ids": [
- "lvm-pv-uuid-Rcem3W-eXgv-1pPY-Awjb-qlxZ-28dd-a0gjBe"
- ],
- "labels": [],
- "masters": [
- "dm-0"
- ],
- "uuids": []
- },
- "sectors": "37888000",
- "sectorsize": 512,
- "size": "18.07 GB",
- "start": "616448",
- "uuid": null
- },
- "vda3": {
- "holders": [],
- "links": {
- "ids": [],
- "labels": [],
- "masters": [],
- "uuids": [
- "c1e4f499-e2be-44d5-b649-10a40f484de5"
- ]
- },
- "sectors": "2097152",
- "sectorsize": 512,
- "size": "1.00 GB",
- "start": "38504448",
- "uuid": "c1e4f499-e2be-44d5-b649-10a40f484de5"
- }
- },
- "removable": "0",
- "rotational": "1",
- "sas_address": null,
- "sas_device_handle": null,
- "scheduler_mode": "mq-deadline",
- "sectors": "41943040",
- "sectorsize": "512",
- "size": "20.00 GB",
- "support_discard": "0",
- "vendor": "0x1af4",
- "virtual": 1
- }
- },
- "ansible_distribution": "RedHat",
- "ansible_distribution_file_parsed": true,
- "ansible_distribution_file_path": "/etc/redhat-release",
- "ansible_distribution_file_search_string": "Red Hat",
- "ansible_distribution_file_variety": "RedHat",
- "ansible_distribution_major_version": "8",
- "ansible_distribution_release": "Ootpa",
- "ansible_distribution_version": "8.0",
- "ansible_dns": {
- "nameservers": [
- "192.168.0.254"
- ],
- "search": [
- "example.com"
- ]
- },
- "ansible_domain": "example.com",
- "ansible_effective_group_id": 0,
- "ansible_effective_user_id": 0,
- "ansible_enp1s0": {
- "active": true,
- "device": "enp1s0",
- "features": {
- "esp_hw_offload": "off [fixed]",
- "esp_tx_csum_hw_offload": "off [fixed]",
- "fcoe_mtu": "off [fixed]",
- "generic_receive_offload": "on",
- "generic_segmentation_offload": "on",
- "highdma": "on [fixed]",
- "hw_tc_offload": "off [fixed]",
- "l2_fwd_offload": "off [fixed]",
- "large_receive_offload": "off [fixed]",
- "loopback": "off [fixed]",
- "netns_local": "off [fixed]",
- "ntuple_filters": "off [fixed]",
- "receive_hashing": "off [fixed]",
- "rx_all": "off [fixed]",
- "rx_checksumming": "on [fixed]",
- "rx_fcs": "off [fixed]",
- "rx_gro_hw": "off [fixed]",
- "rx_udp_tunnel_port_offload": "off [fixed]",
- "rx_vlan_filter": "on [fixed]",
- "rx_vlan_offload": "off [fixed]",
- "rx_vlan_stag_filter": "off [fixed]",
- "rx_vlan_stag_hw_parse": "off [fixed]",
- "scatter_gather": "on",
- "tcp_segmentation_offload": "on",
- "tls_hw_record": "off [fixed]",
- "tls_hw_tx_offload": "off [fixed]",
- "tx_checksum_fcoe_crc": "off [fixed]",
- "tx_checksum_ip_generic": "on",
- "tx_checksum_ipv4": "off [fixed]",
- "tx_checksum_ipv6": "off [fixed]",
- "tx_checksum_sctp": "off [fixed]",
- "tx_checksumming": "on",
- "tx_esp_segmentation": "off [fixed]",
- "tx_fcoe_segmentation": "off [fixed]",
- "tx_gre_csum_segmentation": "off [fixed]",
- "tx_gre_segmentation": "off [fixed]",
- "tx_gso_partial": "off [fixed]",
- "tx_gso_robust": "on [fixed]",
- "tx_ipxip4_segmentation": "off [fixed]",
- "tx_ipxip6_segmentation": "off [fixed]",
- "tx_lockless": "off [fixed]",
- "tx_nocache_copy": "off",
- "tx_scatter_gather": "on",
- "tx_scatter_gather_fraglist": "off [fixed]",
- "tx_sctp_segmentation": "off [fixed]",
- "tx_tcp6_segmentation": "on",
- "tx_tcp_ecn_segmentation": "on",
- "tx_tcp_mangleid_segmentation": "off",
- "tx_tcp_segmentation": "on",
- "tx_udp_segmentation": "off [fixed]",
- "tx_udp_tnl_csum_segmentation": "off [fixed]",
- "tx_udp_tnl_segmentation": "off [fixed]",
- "tx_vlan_offload": "off [fixed]",
- "tx_vlan_stag_hw_insert": "off [fixed]",
- "udp_fragmentation_offload": "off",
- "vlan_challenged": "off [fixed]"
- },
- "hw_timestamp_filters": [],
- "ipv4": {
- "address": "192.168.0.101",
- "broadcast": "192.168.0.255",
- "netmask": "255.255.255.0",
- "network": "192.168.0.0"
- },
- "ipv6": [
- {
- "address": "fe80::5054:ff:fefb:e6e2",
- "prefix": "64",
- "scope": "link"
- }
- ],
- "macaddress": "52:54:00:fb:e6:e2",
- "module": "virtio_net",
- "mtu": 1500,
- "pciid": "virtio0",
- "promisc": false,
- "speed": -1,
- "timestamping": [
- "tx_software",
- "rx_software",
- "software"
- ],
- "type": "ether"
- },
- "ansible_env": {
- "HOME": "/root",
- "LANG": "C",
- "LC_ALL": "C",
- "LC_CTYPE": "C.UTF-8",
- "LC_MESSAGES": "C",
- "LC_NUMERIC": "C",
- "LOGNAME": "root",
- "LS_COLORS": "rs=0:di=38;5;33:ln=38;5;51:mh=00: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=01;05;37;41:su=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;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;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:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=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:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=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:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:",
- "MAIL": "/var/mail/student",
- "PATH": "/sbin:/bin:/usr/sbin:/usr/bin",
- "PWD": "/home/student",
- "SHELL": "/bin/bash",
- "SHLVL": "1",
- "SUDO_COMMAND": "/bin/sh -c echo BECOME-SUCCESS-wjarhrhrhsgjfriyeimzwqefaqoflwfi ; /usr/libexec/platform-python /home/student/.ansible/tmp/ansible-tmp-1596631542.0631795-29656959781552/AnsiballZ_setup.py",
- "SUDO_GID": "2023",
- "SUDO_UID": "2023",
- "SUDO_USER": "student",
- "TERM": "xterm-256color",
- "USER": "root",
- "USERNAME": "root",
- "_": "/usr/libexec/platform-python"
- },
- "ansible_fibre_channel_wwn": [],
- "ansible_fips": false,
- "ansible_form_factor": "Other",
- "ansible_fqdn": "server1.example.com",
- "ansible_hostname": "server1",
- "ansible_hostnqn": "",
- "ansible_interfaces": [
- "lo",
- "virbr0-nic",
- "virbr0",
- "enp1s0"
- ],
- "ansible_is_chroot": false,
- "ansible_iscsi_iqn": "iqn.1994-05.com.redhat:f5623e69ce84",
- "ansible_kernel": "4.18.0-80.el8.x86_64",
- "ansible_lo": {
- "active": true,
- "device": "lo",
- "features": {
- "esp_hw_offload": "off [fixed]",
- "esp_tx_csum_hw_offload": "off [fixed]",
- "fcoe_mtu": "off [fixed]",
- "generic_receive_offload": "on",
- "generic_segmentation_offload": "on",
- "highdma": "on [fixed]",
- "hw_tc_offload": "off [fixed]",
- "l2_fwd_offload": "off [fixed]",
- "large_receive_offload": "off [fixed]",
- "loopback": "on [fixed]",
- "netns_local": "on [fixed]",
- "ntuple_filters": "off [fixed]",
- "receive_hashing": "off [fixed]",
- "rx_all": "off [fixed]",
- "rx_checksumming": "on [fixed]",
- "rx_fcs": "off [fixed]",
- "rx_gro_hw": "off [fixed]",
- "rx_udp_tunnel_port_offload": "off [fixed]",
- "rx_vlan_filter": "off [fixed]",
- "rx_vlan_offload": "off [fixed]",
- "rx_vlan_stag_filter": "off [fixed]",
- "rx_vlan_stag_hw_parse": "off [fixed]",
- "scatter_gather": "on",
- "tcp_segmentation_offload": "on",
- "tls_hw_record": "off [fixed]",
- "tls_hw_tx_offload": "off [fixed]",
- "tx_checksum_fcoe_crc": "off [fixed]",
- "tx_checksum_ip_generic": "on [fixed]",
- "tx_checksum_ipv4": "off [fixed]",
- "tx_checksum_ipv6": "off [fixed]",
- "tx_checksum_sctp": "on [fixed]",
- "tx_checksumming": "on",
- "tx_esp_segmentation": "off [fixed]",
- "tx_fcoe_segmentation": "off [fixed]",
- "tx_gre_csum_segmentation": "off [fixed]",
- "tx_gre_segmentation": "off [fixed]",
- "tx_gso_partial": "off [fixed]",
- "tx_gso_robust": "off [fixed]",
- "tx_ipxip4_segmentation": "off [fixed]",
- "tx_ipxip6_segmentation": "off [fixed]",
- "tx_lockless": "on [fixed]",
- "tx_nocache_copy": "off [fixed]",
- "tx_scatter_gather": "on [fixed]",
- "tx_scatter_gather_fraglist": "on [fixed]",
- "tx_sctp_segmentation": "on",
- "tx_tcp6_segmentation": "on",
- "tx_tcp_ecn_segmentation": "on",
- "tx_tcp_mangleid_segmentation": "on",
- "tx_tcp_segmentation": "on",
- "tx_udp_segmentation": "off [fixed]",
- "tx_udp_tnl_csum_segmentation": "off [fixed]",
- "tx_udp_tnl_segmentation": "off [fixed]",
- "tx_vlan_offload": "off [fixed]",
- "tx_vlan_stag_hw_insert": "off [fixed]",
- "udp_fragmentation_offload": "off",
- "vlan_challenged": "on [fixed]"
- },
- "hw_timestamp_filters": [],
- "ipv4": {
- "address": "127.0.0.1",
- "broadcast": "host",
- "netmask": "255.0.0.0",
- "network": "127.0.0.0"
- },
- "ipv6": [
- {
- "address": "::1",
- "prefix": "128",
- "scope": "host"
- }
- ],
- "mtu": 65536,
- "promisc": false,
- "timestamping": [
- "tx_software",
- "rx_software",
- "software"
- ],
- "type": "loopback"
- },
- "ansible_local": {},
- "ansible_lsb": {},
- "ansible_lvm": {
- "lvs": {
- "root": {
- "size_g": "17.97",
- "vg": "RAC12crhel7"
- }
- },
- "pvs": {
- "/dev/vda2": {
- "free_g": "0.09",
- "size_g": "18.06",
- "vg": "RAC12crhel7"
- }
- },
- "vgs": {
- "RAC12crhel7": {
- "free_g": "0.09",
- "num_lvs": "1",
- "num_pvs": "1",
- "size_g": "18.06"
- }
- }
- },
- "ansible_machine": "x86_64",
- "ansible_machine_id": "b21f44f0957740ec8aa3b1900a9821bd",
- "ansible_memfree_mb": 704,
- "ansible_memory_mb": {
- "nocache": {
- "free": 1203,
- "used": 625
- },
- "real": {
- "free": 704,
- "total": 1828,
- "used": 1124
- },
- "swap": {
- "cached": 0,
- "free": 1023,
- "total": 1023,
- "used": 0
- }
- },
- "ansible_memtotal_mb": 1828,
- "ansible_mounts": [
- {
- "block_available": 3455276,
- "block_size": 4096,
- "block_total": 4707840,
- "block_used": 1252564,
- "device": "/dev/mapper/RAC12crhel7-root",
- "fstype": "xfs",
- "inode_available": 9295800,
- "inode_total": 9420800,
- "inode_used": 125000,
- "mount": "/",
- "options": "rw,seclabel,relatime,attr2,inode64,noquota",
- "size_available": 14152810496,
- "size_total": 19283312640,
- "uuid": "0ccf2fb6-16c6-4467-9dcf-6d68857b6339"
- },
- {
- "block_available": 37918,
- "block_size": 4096,
- "block_total": 75432,
- "block_used": 37514,
- "device": "/dev/vda1",
- "fstype": "xfs",
- "inode_available": 153299,
- "inode_total": 153600,
- "inode_used": 301,
- "mount": "/boot",
- "options": "rw,seclabel,relatime,attr2,inode64,noquota",
- "size_available": 155312128,
- "size_total": 308969472,
- "uuid": "c392dc14-3544-4194-835b-79442df21476"
- },
- {
- "block_available": 0,
- "block_size": 4096,
- "block_total": 0,
- "block_used": 0,
- "device": "/etc/auto.misc",
- "fstype": "autofs",
- "inode_available": 0,
- "inode_total": 0,
- "inode_used": 0,
- "mount": "/misc",
- "options": "rw,relatime,fd=5,pgrp=1793,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=34535",
- "size_available": 0,
- "size_total": 0,
- "uuid": "N/A"
- },
- {
- "block_available": 0,
- "block_size": 4096,
- "block_total": 0,
- "block_used": 0,
- "device": "/etc/auto.guests",
- "fstype": "autofs",
- "inode_available": 0,
- "inode_total": 0,
- "inode_used": 0,
- "mount": "/home/guests",
- "options": "rw,relatime,fd=11,pgrp=1793,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=36222",
- "size_available": 0,
- "size_total": 0,
- "uuid": "N/A"
- }
- ],
- "ansible_nodename": "server1.example.com",
- "ansible_os_family": "RedHat",
- "ansible_pkg_mgr": "dnf",
- "ansible_proc_cmdline": {
- "BOOT_IMAGE": "(hd0,msdos1)/vmlinuz-4.18.0-80.el8.x86_64",
- "crashkernel": "auto",
- "quiet": true,
- "rd.lvm.lv": "RAC12crhel7/root",
- "resume": "UUID=c1e4f499-e2be-44d5-b649-10a40f484de5",
- "rhgb": true,
- "ro": true,
- "root": "/dev/mapper/RAC12crhel7-root"
- },
- "ansible_processor": [
- "0",
- "GenuineIntel",
- "Intel Core Processor (Haswell, no TSX)",
- "1",
- "GenuineIntel",
- "Intel Core Processor (Haswell, no TSX)",
- "2",
- "GenuineIntel",
- "Intel Core Processor (Haswell, no TSX)",
- "3",
- "GenuineIntel",
- "Intel Core Processor (Haswell, no TSX)"
- ],
- "ansible_processor_cores": 1,
- "ansible_processor_count": 4,
- "ansible_processor_threads_per_core": 1,
- "ansible_processor_vcpus": 4,
- "ansible_product_name": "KVM",
- "ansible_product_serial": "NA",
- "ansible_product_uuid": "b21f44f0-9577-40ec-8aa3-b1900a9821bd",
- "ansible_product_version": "RHEL-7.6.0 PC (Q35 + ICH9, 2009)",
- "ansible_python": {
- "executable": "/usr/libexec/platform-python",
- "has_sslcontext": true,
- "type": "cpython",
- "version": {
- "major": 3,
- "micro": 8,
- "minor": 6,
- "releaselevel": "final",
- "serial": 0
- },
- "version_info": [
- 3,
- 6,
- 8,
- "final",
- 0
- ]
- },
- "ansible_python_version": "3.6.8",
- "ansible_real_group_id": 0,
- "ansible_real_user_id": 0,
- "ansible_selinux": {
- "config_mode": "enforcing",
- "mode": "enforcing",
- "policyvers": 31,
- "status": "enabled",
- "type": "targeted"
- },
- "ansible_selinux_python_present": true,
- "ansible_service_mgr": "systemd",
- "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEDK6EfPHxNnEXayAL64IuReyV5wYMI7wAtCcz3E0hl3iWSsaYm20GX6e/QRs+hMeVIPlKEfP/zZfgksjGDG4T8=",
- "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIMBMOkk5JFmgpiy6XZ4IWyz7rFkcmc/ZGJpr+hTeQqOc",
- "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCxU3kLhuc5KO1iRie7KwdIjZ8WB+/b7rGeTxiHXZkqr9AajnueZb8cU3W8CG+RAjFtGBDDdGcZwWmdCnTQoxqNtCTlnQ3FwOc+ykzyLSDjAl9ZowonbjrUPEddgtE9azLWv2fWTtwVLRJ5EwVj8tG3OT/G3MzEoQBALTx0o2KMbP2oRtimvCz5ngKz7ERs5ksvdZAt4e9jz5dmcXfExF8Zfm9wuLz3+UDb4pwVr934V4dvBpHzrLCIRNzfk6jdPqS+PVuJTvutAjNX55BAwCIJX+9M8y5QlATvlITE8tC0j+09AWoDZW1jVcrJlBqjwnLjO86sUZzZ22xe5YouANhn",
- "ansible_swapfree_mb": 1023,
- "ansible_swaptotal_mb": 1023,
- "ansible_system": "Linux",
- "ansible_system_capabilities": [
- "cap_chown",
- "cap_dac_override",
- "cap_dac_read_search",
- "cap_fowner",
- "cap_fsetid",
- "cap_kill",
- "cap_setgid",
- "cap_setuid",
- "cap_setpcap",
- "cap_linux_immutable",
- "cap_net_bind_service",
- "cap_net_broadcast",
- "cap_net_admin",
- "cap_net_raw",
- "cap_ipc_lock",
- "cap_ipc_owner",
- "cap_sys_module",
- "cap_sys_rawio",
- "cap_sys_chroot",
- "cap_sys_ptrace",
- "cap_sys_pacct",
- "cap_sys_admin",
- "cap_sys_boot",
- "cap_sys_nice",
- "cap_sys_resource",
- "cap_sys_time",
- "cap_sys_tty_config",
- "cap_mknod",
- "cap_lease",
- "cap_audit_write",
- "cap_audit_control",
- "cap_setfcap",
- "cap_mac_override",
- "cap_mac_admin",
- "cap_syslog",
- "cap_wake_alarm",
- "cap_block_suspend",
- "cap_audit_read+ep"
- ],
- "ansible_system_capabilities_enforced": "True",
- "ansible_system_vendor": "Red Hat",
- "ansible_uptime_seconds": 3398,
- "ansible_user_dir": "/root",
- "ansible_user_gecos": "root",
- "ansible_user_gid": 0,
- "ansible_user_id": "root",
- "ansible_user_shell": "/bin/bash",
- "ansible_user_uid": 0,
- "ansible_userspace_architecture": "x86_64",
- "ansible_userspace_bits": "64",
- "ansible_virbr0": {
- "active": false,
- "device": "virbr0",
- "features": {
- "esp_hw_offload": "off [fixed]",
- "esp_tx_csum_hw_offload": "off [fixed]",
- "fcoe_mtu": "off [fixed]",
- "generic_receive_offload": "on",
- "generic_segmentation_offload": "on",
- "highdma": "off [requested on]",
- "hw_tc_offload": "off [fixed]",
- "l2_fwd_offload": "off [fixed]",
- "large_receive_offload": "off [fixed]",
- "loopback": "off [fixed]",
- "netns_local": "on [fixed]",
- "ntuple_filters": "off [fixed]",
- "receive_hashing": "off [fixed]",
- "rx_all": "off [fixed]",
- "rx_checksumming": "off [fixed]",
- "rx_fcs": "off [fixed]",
- "rx_gro_hw": "off [fixed]",
- "rx_udp_tunnel_port_offload": "off [fixed]",
- "rx_vlan_filter": "off [fixed]",
- "rx_vlan_offload": "off [fixed]",
- "rx_vlan_stag_filter": "off [fixed]",
- "rx_vlan_stag_hw_parse": "off [fixed]",
- "scatter_gather": "on",
- "tcp_segmentation_offload": "on",
- "tls_hw_record": "off [fixed]",
- "tls_hw_tx_offload": "off [fixed]",
- "tx_checksum_fcoe_crc": "off [fixed]",
- "tx_checksum_ip_generic": "on",
- "tx_checksum_ipv4": "off [fixed]",
- "tx_checksum_ipv6": "off [fixed]",
- "tx_checksum_sctp": "off [fixed]",
- "tx_checksumming": "on",
- "tx_esp_segmentation": "on",
- "tx_fcoe_segmentation": "off [requested on]",
- "tx_gre_csum_segmentation": "on",
- "tx_gre_segmentation": "on",
- "tx_gso_partial": "on",
- "tx_gso_robust": "off [requested on]",
- "tx_ipxip4_segmentation": "on",
- "tx_ipxip6_segmentation": "on",
- "tx_lockless": "on [fixed]",
- "tx_nocache_copy": "off",
- "tx_scatter_gather": "on",
- "tx_scatter_gather_fraglist": "on",
- "tx_sctp_segmentation": "off [requested on]",
- "tx_tcp6_segmentation": "on",
- "tx_tcp_ecn_segmentation": "on",
- "tx_tcp_mangleid_segmentation": "on",
- "tx_tcp_segmentation": "on",
- "tx_udp_segmentation": "on",
- "tx_udp_tnl_csum_segmentation": "on",
- "tx_udp_tnl_segmentation": "on",
- "tx_vlan_offload": "on",
- "tx_vlan_stag_hw_insert": "on",
- "udp_fragmentation_offload": "off",
- "vlan_challenged": "off [fixed]"
- },
- "hw_timestamp_filters": [],
- "id": "8000.525400876dea",
- "interfaces": [
- "virbr0-nic"
- ],
- "ipv4": {
- "address": "192.168.122.1",
- "broadcast": "192.168.122.255",
- "netmask": "255.255.255.0",
- "network": "192.168.122.0"
- },
- "macaddress": "52:54:00:87:6d:ea",
- "mtu": 1500,
- "promisc": false,
- "stp": true,
- "timestamping": [
- "rx_software",
- "software"
- ],
- "type": "bridge"
- },
- "ansible_virbr0_nic": {
- "active": false,
- "device": "virbr0-nic",
- "features": {
- "esp_hw_offload": "off [fixed]",
- "esp_tx_csum_hw_offload": "off [fixed]",
- "fcoe_mtu": "off [fixed]",
- "generic_receive_offload": "on",
- "generic_segmentation_offload": "on",
- "highdma": "off [fixed]",
- "hw_tc_offload": "off [fixed]",
- "l2_fwd_offload": "off [fixed]",
- "large_receive_offload": "off [fixed]",
- "loopback": "off [fixed]",
- "netns_local": "off [fixed]",
- "ntuple_filters": "off [fixed]",
- "receive_hashing": "off [fixed]",
- "rx_all": "off [fixed]",
- "rx_checksumming": "off [fixed]",
- "rx_fcs": "off [fixed]",
- "rx_gro_hw": "off [fixed]",
- "rx_udp_tunnel_port_offload": "off [fixed]",
- "rx_vlan_filter": "off [fixed]",
- "rx_vlan_offload": "off [fixed]",
- "rx_vlan_stag_filter": "off [fixed]",
- "rx_vlan_stag_hw_parse": "off [fixed]",
- "scatter_gather": "on",
- "tcp_segmentation_offload": "off",
- "tls_hw_record": "off [fixed]",
- "tls_hw_tx_offload": "off [fixed]",
- "tx_checksum_fcoe_crc": "off [fixed]",
- "tx_checksum_ip_generic": "off [requested on]",
- "tx_checksum_ipv4": "off [fixed]",
- "tx_checksum_ipv6": "off [fixed]",
- "tx_checksum_sctp": "off [fixed]",
- "tx_checksumming": "off",
- "tx_esp_segmentation": "off [fixed]",
- "tx_fcoe_segmentation": "off [fixed]",
- "tx_gre_csum_segmentation": "off [fixed]",
- "tx_gre_segmentation": "off [fixed]",
- "tx_gso_partial": "off [fixed]",
- "tx_gso_robust": "off [fixed]",
- "tx_ipxip4_segmentation": "off [fixed]",
- "tx_ipxip6_segmentation": "off [fixed]",
- "tx_lockless": "on [fixed]",
- "tx_nocache_copy": "off",
- "tx_scatter_gather": "on",
- "tx_scatter_gather_fraglist": "on",
- "tx_sctp_segmentation": "off [fixed]",
- "tx_tcp6_segmentation": "off [requested on]",
- "tx_tcp_ecn_segmentation": "off [requested on]",
- "tx_tcp_mangleid_segmentation": "off",
- "tx_tcp_segmentation": "off [requested on]",
- "tx_udp_segmentation": "off [fixed]",
- "tx_udp_tnl_csum_segmentation": "off [fixed]",
- "tx_udp_tnl_segmentation": "off [fixed]",
- "tx_vlan_offload": "on",
- "tx_vlan_stag_hw_insert": "on",
- "udp_fragmentation_offload": "off",
- "vlan_challenged": "off [fixed]"
- },
- "hw_timestamp_filters": [],
- "macaddress": "52:54:00:87:6d:ea",
- "mtu": 1500,
- "promisc": true,
- "timestamping": [
- "tx_software",
- "rx_software",
- "software"
- ],
- "type": "ether"
- },
- "ansible_virtualization_role": "guest",
- "ansible_virtualization_type": "kvm",
- "discovered_interpreter_python": "/usr/libexec/platform-python",
- "gather_subset": [
- "all"
- ],
- "module_setup": true
- },
- "changed": false
- }
- [student@classroom ansible]$
复制代码 普查操作结果的过滤:
- [student@classroom ansible]$ ansible classroom.example.com -m setup -a 'filter="ansible_mounts"'
复制代码
|
|