"ansible_nodename": "livecd.centos", "ansible_os_family": "RedHat", "ansible_pkg_mgr": "yum", "ansible_processor": [ "GenuineIntel", "Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 1, "ansible_processor_threads_per_core...
ansible all -m setup -a "filter=ansible_memfree_mb" ansible all -m setup -a "filter=ansible_os_family" #去操作系统版本 ansible all -m setup -a "filter=ansible_distribution_major_version" ansible all -m setup -a "filter=ansible_distribution_version" ansible all -m setup -a "filter=an...
ansible_hostname ansible_os_family ansible_pkg_mgr ansible_default_ipv4.address ansible_default_ipv6.address 关闭自动采集 - hosts: whatever gather_facts: no 自定义目标系统facts 在远程主机/etc/ansible/facts.d/目录下创建.fact 结尾的文件,也可以是json、ini 或者返回json 格式数据的可执行文件,这些将被...
roles: - { role: role_name, when: "ansible_os_family == 'RedHat'" } #传参 1. 2. 3. 4. 3.1 创建role的步骤 (1) 创建以roles命名的目录; (2) 在roles目录中分别创建以各角色名称命名的目录,如webservers等; (3) 在每个角色命名的目录中分别创建files、handlers、meta、tasks、templates和vars目...
ansible_os_family ansible_selinux 还有许多其他Ansible特殊变量,这些只是一些示例。 这些变量可以在Jinja2模板中使用,如下所示: The hostname of this webserver is {{ ansible_hostname }}It is running on {{ ansible_os_family}}system 3.Inventory变量 最后,在列表中,我们有Ansible Inventory变量。
facts组件是Ansible用于采集被管理机器设备信息的一个功能。 我们可以通过setup模块查看机器的所有facts信息,同时可以使用filter来查看指定信息。 执行ansible 127.0.0.1 -m setup: 148.70.122.28| SUCCESS =>{"ansible_facts": {"ansible_all_ipv4_addresses": ["172.17.0.1","172.27.16.8"],"ansible_all_ipv6_ad...
os_family,pkg_mgr,platform,processor,processor_cores,processor_count,python,python_version,real_user_id,selinux,service_mgr,ssh_host_key_dsa_public,ssh_host_key_ecdsa_public,ssh_host_key_ed25519_public,ssh_host_key_rsa_public,ssh_host_pub_keys,ssh_pub_keys,system,system_capabilities,system_...
osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt ...
"ansible_os_family": "RedHat", "ansible_pkg_mgr": "yum", "ansible_proc_cmdline": { "BOOT_IMAGE": "/vmlinuz-3.10.0-1160.6.1.el7.x86_64", "LANG": "en_US.UTF-8", "net.ifnames": "0", "quiet": true, "rd.lvm.lv": [ "centos/root", "centos/swap" ], "...
"ansible_memfree_mb": 115, "ansible_memtotal_mb": 249, "ansible_module_setup": true, "ansible_os_family": "FortiOS", "ansible_processor_vcpus": 1, "ansible_product_name": "Fortigate-50B", "ansible_product_serial": "FGT50B3Gxxxxxxxx", "ansible_system_vendor": "Fortinet" }, "chang...