ansible api调用实例
时间: 2019-11-29来源:OSCHINA
前景提要
「深度学习福利」大神带你进阶工程师,立即查看>>>
类似于执行:ansible all -m setup cat 1.py #!/usr/bin/env python #coding=utf-8 #------------------------------------------模块的导入----------------------------------------------- import json import shutil from ansible.module_utils.common.collections import ImmutableDict from ansible.parsing.dataloader import DataLoader from ansible.vars.manager import VariableManager from ansible.inventory.manager import InventoryManager from ansible.playbook.play import Play from ansible.executor.task_queue_manager import TaskQueueManager from ansible.plugins.callback import CallbackBase from ansible import context import ansible.constants as C #类-------------------------------------------继承CallbackBase类------------------------------------ class ResultCallback(CallbackBase): def v2_runner_on_ok(self, result, **kwargs): host = result._host #该主机信息:result._host #运行的是那个任务名称:result.task_name #运行的结果:result._result #正对哪个主机:host.name #这里打印针对哪个主机,结果是什么 print(json.dumps({host.name: result._result}, indent=4)) #'这里可对返回结果进行截取重组' #----------------------------------------无需修改内容---------------------------------------------- #smart表示执行远程命令,forks表示并发 context.CLIARGS = ImmutableDict(connection='local', module_path=[], forks=10, become=None, become_method=None, become_user=None, check=False, diff=False) #加载数据的类,加载剧本等 loader = DataLoader() #切换用户的密码,剧本加密等 #passwords = dict(vault_pass='secret') passwords={} #实例化 results_callback = ResultCallback() #剧本管理,sources指定剧本路径 inventory = InventoryManager(loader=loader, sources='localhost,') #对剧本中的变量进行管理 variable_manager = VariableManager(loader=loader, inventory=inventory) #-------------------------------------需要修改的内容:-------------------------------------------------- #重要,tasks里面编写任务,ansible all -i etc/ansbile/hosts -m setup play_source = { 'name':"test",#剧本名称 'hosts':'all', #剧本hosts,在那些主机上执行 'gather_facts': 'no', #关闭执行剧本前对所以机器信息的收集 'tasks' :[ #列表可执行多个任务,name表示任务名称,setup表示模板名称 { 'name':'fact','setup':''}, ] } #----------------------------------------回调----------------------------------------------- #任务装载执行那个play,任务变量有哪些 play = Play().load(play_source, variable_manager=variable_manager, loader=loader) tqm = None try: #定义任务管理器,传入剧本,变量等 tqm = TaskQueueManager( inventory=inventory,#剧本 variable_manager=variable_manager,#变量 loader=loader, passwords=passwords, stdout_callback=results_callback, #回调 ) result = tqm.run(play) #运行剧本 finally: #执行完成后任务清理后台临时数据 if tqm is not None: tqm.cleanup() shutil.rmtree(C.DEFAULT_LOCAL_TMP, True)
执行结果:python 1.py 127.0.0.1 | SUCCESS => { "ansible_facts": { "ansible_all_ipv4_addresses": [ "172.17.0.1", "172.16.235.11" ], "ansible_all_ipv6_addresses": [], "ansible_apparmor": { "status": "disabled" }, "ansible_architecture": "x86_64", "ansible_bios_date": "04/01/2014", "ansible_bios_version": "3288b3c", "ansible_cmdline": { "BOOT_IMAGE": "/boot/vmlinuz-3.10.0-957.21.3.el7.x86_64", "LANG": "en_US.UTF-8", "biosdevname": "0", "console": "ttyS0,115200n8", "crashkernel": "auto", "idle": "halt", "net.ifnames": "0", "noibrs": true, "quiet": true, "rhgb": true, "ro": true, "root": "UUID=1114fe9e-2309-4580-b183-d778e6d97397" }, "ansible_date_time": { "date": "2019-11-29", "day": "29", "epoch": "1575028422", "hour": "19", "iso8601": "2019-11-29T11:53:42Z", "iso8601_basic": "20191129T195342834656", "iso8601_basic_short": "20191129T195342", "iso8601_micro": "2019-11-29T11:53:42.834755Z", "minute": "53", "month": "11", "second": "42", "time": "19:53:42", "tz": "CST", "tz_offset": "+0800", "weekday": "Friday", "weekday_number": "5", "weeknumber": "47", "year": "2019" }, "ansible_default_ipv4": { "address": "172.16.235.11", "alias": "eth0", "broadcast": "172.16.239.255", "gateway": "172.16.239.253", "interface": "eth0", "macaddress": "00:16:3e:11:9b:be", "mtu": 1500, "netmask": "255.255.240.0", "network": "172.16.224.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_device_links": { "ids": {}, "labels": {}, "masters": {}, "uuids": { "vda1": [ "1114fe9e-2309-4580-b183-d778e6d97397" ] } }, "ansible_devices": { "vda": { "holders": [], "host": "SCSI storage controller: Red Hat, Inc. Virtio block device", "links": { "ids": [], "labels": [], "masters": [], "uuids": [] }, "model": null, "partitions": { "vda1": { "holders": [], "links": { "ids": [], "labels": [], "masters": [], "uuids": [ "1114fe9e-2309-4580-b183-d778e6d97397" ] }, "sectors": "83873317", "sectorsize": 512, "size": "39.99 GB", "start": "2048", "uuid": "1114fe9e-2309-4580-b183-d778e6d97397" } }, "removable": "0", "rotational": "1", "sas_address": null, "sas_device_handle": null, "scheduler_mode": "mq-deadline", "sectors": "83886080", "sectorsize": "512", "size": "40.00 GB", "support_discard": "0", "vendor": "0x1af4", "virtual": 1 } }, "ansible_distribution": "CentOS", "ansible_distribution_file_parsed": true, "ansible_distribution_file_path": "/etc/redhat-release", "ansible_distribution_file_variety": "RedHat", "ansible_distribution_major_version": "7", "ansible_distribution_release": "Core", "ansible_distribution_version": "7.6", "ansible_dns": { "nameservers": [ "100.100.2.136", "100.100.2.138" ], "options": { "attempts": "3", "rotate": true, "single-request-reopen": true, "timeout": "2" } }, "ansible_docker0": { "active": true, "device": "docker0", "features": { "busy_poll": "off [fixed]", "fcoe_mtu": "off [fixed]", "generic_receive_offload": "on", "generic_segmentation_offload": "on", "highdma": "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", "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_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_ipip_segmentation": "on", "tx_lockless": "on [fixed]", "tx_nocache_copy": "off", "tx_scatter_gather": "on", "tx_scatter_gather_fraglist": "on", "tx_sctp_segmentation": "on", "tx_sit_segmentation": "on", "tx_tcp6_segmentation": "on", "tx_tcp_ecn_segmentation": "on", "tx_tcp_mangleid_segmentation": "on", "tx_tcp_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": "on", "vlan_challenged": "off [fixed]" }, "hw_timestamp_filters": [], "id": "8000.0242e36a5228", "interfaces": [ "vethd3a18be" ], "ipv4": { "address": "172.17.0.1", "broadcast": "172.17.255.255", "netmask": "255.255.0.0", "network": "172.17.0.0" }, "macaddress": "02:42:e3:6a:52:28", "mtu": 1500, "promisc": false, "stp": false, "timestamping": [ "rx_software", "software" ], "type": "bridge" }, "ansible_domain": "", "ansible_effective_group_id": 0, "ansible_effective_user_id": 0, "ansible_env": { "HOME": "/root", "LANG": "en_US.UTF-8", "LESSOPEN": "||/usr/bin/lesspipe.sh %s", "LOGNAME": "root", "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:", "MAIL": "/var/mail/root", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin", "PWD": "/root", "SHELL": "/bin/bash", "SHLVL": "2", "SSH_CLIENT": "127.0.0.1 57402 22", "SSH_CONNECTION": "127.0.0.1 57402 127.0.0.1 22", "SSH_TTY": "/dev/pts/4", "TERM": "xterm", "USER": "root", "XDG_RUNTIME_DIR": "/run/user/0", "XDG_SESSION_ID": "16616", "_": "/usr/bin/python" }, "ansible_eth0": { "active": true, "device": "eth0", "features": { "busy_poll": "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", "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_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_ipip_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_sit_segmentation": "off [fixed]", "tx_tcp6_segmentation": "on", "tx_tcp_ecn_segmentation": "on", "tx_tcp_mangleid_segmentation": "off", "tx_tcp_segmentation": "on", "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": "on", "vlan_challenged": "off [fixed]" }, "hw_timestamp_filters": [], "ipv4": { "address": "172.16.235.11", "broadcast": "172.16.239.255", "netmask": "255.255.240.0", "network": "172.16.224.0" }, "macaddress": "00:16:3e:11:9b:be", "module": "virtio_net", "mtu": 1500, "pciid": "virtio0", "promisc": false, "timestamping": [ "rx_software", "software" ], "type": "ether" }, "ansible_fibre_channel_wwn": [], "ansible_fips": false, "ansible_form_factor": "Other", "ansible_fqdn": "iZbp198ltire1iou0oamr0Z", "ansible_hostname": "bestyunyan", "ansible_hostnqn": "", "ansible_interfaces": [ "lo", "vethd3a18be", "docker0", "eth0" ], "ansible_is_chroot": false, "ansible_iscsi_iqn": "", "ansible_kernel": "3.10.0-957.21.3.el7.x86_64", "ansible_kernel_version": "#1 SMP Tue Jun 18 16:35:19 UTC 2019", "ansible_lo": { "active": true, "device": "lo", "features": { "busy_poll": "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", "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_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_ipip_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_sit_segmentation": "off [fixed]", "tx_tcp6_segmentation": "on", "tx_tcp_ecn_segmentation": "on", "tx_tcp_mangleid_segmentation": "on", "tx_tcp_segmentation": "on", "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": "on", "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" }, "mtu": 65536, "promisc": false, "timestamping": [ "rx_software", "software" ], "type": "loopback" }, "ansible_local": {}, "ansible_lsb": { "codename": "Core", "description": "CentOS Linux release 7.6.1810 (Core)", "id": "CentOS", "major_release": "7", "release": "7.6.1810" }, "ansible_lvm": { "lvs": {}, "pvs": {}, "vgs": {} }, "ansible_machine": "x86_64", "ansible_machine_id": "20190711105006363114529432776998", "ansible_memfree_mb": 161, "ansible_memory_mb": { "nocache": { "free": 1095, "used": 743 }, "real": { "free": 161, "total": 1838, "used": 1677 }, "swap": { "cached": 0, "free": 0, "total": 0, "used": 0 } }, "ansible_memtotal_mb": 1838, "ansible_mounts": [ { "block_available": 8739277, "block_size": 4096, "block_total": 10286868, "block_used": 1547591, "device": "/dev/vda1", "fstype": "ext4", "inode_available": 2466821, "inode_total": 2621440, "inode_used": 154619, "mount": "/", "options": "rw,relatime,data=ordered", "size_available": 35796078592, "size_total": 42135011328, "uuid": "1114fe9e-2309-4580-b183-d778e6d97397" } ], "ansible_nodename": "bestyunyan", "ansible_os_family": "RedHat", "ansible_pkg_mgr": "yum", "ansible_proc_cmdline": { "BOOT_IMAGE": "/boot/vmlinuz-3.10.0-957.21.3.el7.x86_64", "LANG": "en_US.UTF-8", "biosdevname": "0", "console": [ "tty0", "ttyS0,115200n8" ], "crashkernel": "auto", "idle": "halt", "net.ifnames": "0", "noibrs": true, "quiet": true, "rhgb": true, "ro": true, "root": "UUID=1114fe9e-2309-4580-b183-d778e6d97397" }, "ansible_processor": [ "0", "GenuineIntel", "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 1, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 1, "ansible_product_name": "Alibaba Cloud ECS", "ansible_product_serial": "0c7a1379-554a-41c2-80de-51d44832d08e", "ansible_product_uuid": "0C7A1379-554A-41C2-80DE-51D44832D08E", "ansible_product_version": "pc-i440fx-2.1", "ansible_python": { "executable": "/usr/bin/python", "has_sslcontext": true, "type": "CPython", "version": { "major": 2, "micro": 5, "minor": 7, "releaselevel": "final", "serial": 0 }, "version_info": [ 2, 7, 5, "final", 0 ] }, "ansible_python_version": "2.7.5", "ansible_real_group_id": 0, "ansible_real_user_id": 0, "ansible_selinux": { "status": "disabled" }, "ansible_selinux_python_present": true, "ansible_service_mgr": "systemd", "ansible_ssh_host_key_dsa_public": "AAAAB3NzaC1kc3MAAACBAJd+s+jOekl4ScPJpTnbT2JC8LjfYrbDCoz0L4c0N6cN+oWbLFR4/Q5RqrVmpZAjRIiXKZfk1y6TIdderbJJshxzvYgc8OJDH7/IgvDzTAlSCPc5T14RMl6Bhrp0vIg4EiMkUhCTgdawjjfV4FUJoKnPwW+d39A5ripOEUYWEJv7AAAAFQCacs4SkpudSFTE5R3k5sHVZFGLaQAAAIAoPI2Pn/UsMHcf2o6FdfQea5nhzzV/Xg/tGBlAzASJ68jMit3vjoyfPvO4P61p3mIS6e3pREeODE6dlADKPbTF8YXkbfXo544cL8RuEI2AGT7UU1wYJNBVQ/y19EJGSiQRLE+QLnizJ69Ce20Ja2mD1uuAp8eiBvcyl4byRfi2nQAAAIAYmlJMFtWu+0bOHc5eYynlnHmGn9l8w3muxlG9g/WB1CPxMczCwHlMqRgxOyM0DUjkDYycGddBqHdwlAu/oVSxSut6GzDHjzwGcK1pPlnqwnFyAiT2oMOX6F1HmZlYeJVSORbIavWMu5evO5DYnCdR4p04x98nE6i7YwYWI+xQ+A==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPmNBvDALEOFEmP9uj+gSxswdpsbhEdCLyUTHktwiwTApcMY/hQjxcE+C5GnuRY2lctaLh64h94eKrk59gKZ8+8=", "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIGkZLb2ZJI1Moi1Uezq6Q/rEadasfyxSiV6dxgS0wQ7F", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDLj4NA2pfWvJf66ucT00Qfn1dyafGlkAe1Src5IfQwY74zUTc5awVhr7iNZn3hJO35m63e8QFJxkeaxe/XDz+sklipJbcuhfDtpFG3sXps+6A08pAdQSPQvj3JRJrow7U0YS9ctpD0sSUjov+xtMMvDEVj92H99EvhkaTUUpqXwWXKkycN5D6hpEE7aIPNHaCy/dYlrZimQitMmuGxbaP5is41FxIM2BkrfL7ZBx4LhilpOHUNRas14OW4sZTHbLUolA2cdRgXs67Y+F9mtVTN0WlyInvw8kuMrMwWeNQ41m2LkY4Vlnvh3nAiPn/xnEmsQw8/5k4utQoAfHFoG4GL", "ansible_swapfree_mb": 0, "ansible_swaptotal_mb": 0, "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", "35", "36+ep" ], "ansible_system_capabilities_enforced": "True", "ansible_system_vendor": "Alibaba Cloud", "ansible_uptime_seconds": 8477706, "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_vethd3a18be": { "active": true, "device": "vethd3a18be", "features": { "busy_poll": "off [fixed]", "fcoe_mtu": "off [fixed]", "generic_receive_offload": "on", "generic_segmentation_offload": "on", "highdma": "on", "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", "rx_fcs": "off [fixed]", "rx_gro_hw": "off [fixed]", "rx_udp_tunnel_port_offload": "off [fixed]", "rx_vlan_filter": "off [fixed]", "rx_vlan_offload": "on", "rx_vlan_stag_filter": "off [fixed]", "rx_vlan_stag_hw_parse": "on", "scatter_gather": "on", "tcp_segmentation_offload": "on", "tx_checksum_fcoe_crc": "off [fixed]", "tx_checksum_ip_generic": "on", "tx_checksum_ipv4": "off [fixed]", "tx_checksum_ipv6": "off [fixed]", "tx_checksum_sctp": "on", "tx_checksumming": "on", "tx_fcoe_segmentation": "off [fixed]", "tx_gre_csum_segmentation": "on", "tx_gre_segmentation": "on", "tx_gso_partial": "off [fixed]", "tx_gso_robust": "off [fixed]", "tx_ipip_segmentation": "on", "tx_lockless": "on [fixed]", "tx_nocache_copy": "off", "tx_scatter_gather": "on", "tx_scatter_gather_fraglist": "on", "tx_sctp_segmentation": "on", "tx_sit_segmentation": "on", "tx_tcp6_segmentation": "on", "tx_tcp_ecn_segmentation": "on", "tx_tcp_mangleid_segmentation": "on", "tx_tcp_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": "on", "vlan_challenged": "off [fixed]" }, "hw_timestamp_filters": [], "macaddress": "52:1f:ac:1d:5f:df", "mtu": 1500, "promisc": true, "speed": 10000, "timestamping": [ "rx_software", "software" ], "type": "ether" }, "ansible_virtualization_role": "guest", "ansible_virtualization_type": "kvm", "discovered_interpreter_python": "/usr/bin/python", "gather_subset": [ "all" ], "module_setup": true }, "changed": false }

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行