CMDB与自动化部署的联动

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CMDB与自动化部署的联动相关的知识,希望对你有一定的参考价值。

无论是chef、ansible等自动化部署工具,还是市场上的一些商用自动化部署平台都可以在运维中与CMDB联动:

  • 自动化部署工作通常是通过部署在被管理机上的agent进行,所以通过agent可以获取主机的配置数据,当然具体的自动化部署软件的不同,获取的配置数据是不同的(文章最后是通过ansible获取centos6.5的配置数据文件),这些数据可以被取出发送到CMDB库中进行更新。
  • 自动化部署工作在部署之前需要获取主机列表、操作系统版本及补丁情况、应用软件、应用端口。。。等,只有符合部署条件的主机才能进行部署工作,这些检查工作可以借助CMDB的数据进行,检查结束后进行部署,部署完毕后,将部署的内容对CMDB的相关内容进行更新,以保证CMDB的准确性。

通过ansible获取的centos6.5的配置信息文件:
CentOS6.5-1 | SUCCESS =>
"ansible_facts":
"ansible_all_ipv4_addresses": [
"10.1.1.76"
],
"ansible_all_ipv6_addresses": [
"fe80::250:56ff:feb6:c581"
],
"ansible_apparmor":
"status": "disabled"
,
"ansible_architecture": "x86_64",
"ansible_bios_date": "07/03/2018",
"ansible_bios_version": "6.00",
"ansible_cmdline":
"KEYBOARDTYPE": "pc",
"KEYTABLE": "us",
"LANG": "zh_CN.UTF-8",
"crashkernel": "128M",
"quiet": true,
"rd_LVM_LV": "VolGroup/lv_root",
"rd_NO_DM": true,
"rd_NO_LUKS": true,
"rd_NO_MD": true,
"rhgb": true,
"ro": true,
"root": "/dev/mapper/VolGroup-lv_root"
,
"ansible_date_time":
"date": "2019-07-26",
"day": "26",
"epoch": "1564125003",
"hour": "15",
"iso8601": "2019-07-26T07:10:03Z",
"iso8601_basic": "20190726T151003742185",
"iso8601_basic_short": "20190726T151003",
"iso8601_micro": "2019-07-26T07:10:03.742355Z",
"minute": "10",
"month": "07",
"second": "03",
"time": "15:10:03",
"tz": "CST",
"tz_offset": "+0800",
"weekday": "星期五",
"weekday_number": "5",
"weeknumber": "29",
"year": "2019"
,
"ansible_default_ipv4":
"address": "10.1.1.76", #IP地址
"alias": "eth0", #网卡eth0
"broadcast": "10.1.255.255",
"gateway": "10.1.1.1", #网关
"interface": "eth0",
"macaddress": "00:50:56:b6:c5:81", #MAC地址
"mtu": 1500,
"netmask": "255.255.0.0", #子网掩码
"network": "10.1.0.0", #网段
"type": "ether" #网卡类型
,
"ansible_default_ipv6": ,
"ansible_device_links":
"ids":
"dm-0": [
"dm-name-VolGroup-lv_root", #VolGroup 逻辑卷组 lv_root 逻辑卷
"dm-uuid-LVM-oYjEjhlM0ixGVg319svf9MCTH8g2a8fHd2GVtBmsxLem0Fi2FrBFZvcScTNM6u7O"
],
"dm-1": [
"dm-name-VolGroup-lv_swap", #lv_swap 逻辑卷
"dm-uuid-LVM-oYjEjhlM0ixGVg319svf9MCTH8g2a8fHoijUT8A3ZKYo2hfbeLZxxGjMqQT13HSA"
]
,
"labels": ,
"masters":
"sda2": [ #dm-0和dm-1使用的sda2这个物理盘
"dm-0",
"dm-1"
]
,
"uuids":
"dm-0": [
"0ecd4fa7-a6fd-49f3-ab4f-ff10acc426b0"
],
"dm-1": [
"e59f27d4-c1a5-47bb-ad49-e893448b8053"
],
"sda1": [
"37907382-32f8-444c-bb05-2b1c9c26e68d"
]

,
"ansible_devices":
"dm-0":
"holders": [],
"host": "",
"links":
"ids": [
"dm-name-VolGroup-lv_root",
"dm-uuid-LVM-oYjEjhlM0ixGVg319svf9MCTH8g2a8fHd2GVtBmsxLem0Fi2FrBFZvcScTNM6u7O"
],
"labels": [],
"masters": [],
"uuids": [
"0ecd4fa7-a6fd-49f3-ab4f-ff10acc426b0"
]
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "74727424",
"sectorsize": "512",
"size": "35.63 GB", #逻辑卷的大小
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"dm-1":
"holders": [],
"host": "",
"links":
"ids": [
"dm-name-VolGroup-lv_swap",
"dm-uuid-LVM-oYjEjhlM0ixGVg319svf9MCTH8g2a8fHoijUT8A3ZKYo2hfbeLZxxGjMqQT13HSA"
],
"labels": [],
"masters": [],
"uuids": [
"e59f27d4-c1a5-47bb-ad49-e893448b8053"
]
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "8126464",
"sectorsize": "512",
"size": "3.88 GB", #逻辑卷的大小
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop0":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop1":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop2":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop3":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop4":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop5":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop6":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"loop7":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "0",
"sectorsize": "512",
"size": "0.00 Bytes",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram0":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram1":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram10":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram11":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram12":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram13":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram14":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram15":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram2":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram3":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram4":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram5":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram6":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram7":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram8":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"ram9":
"holders": [],
"host": "",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": null,
"partitions": ,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "",
"sectors": "32768",
"sectorsize": "512",
"size": "16.00 MB",
"support_discard": "0",
"vendor": null,
"virtual": 1
,
"sda": #硬盘
"holders": [],
"host": "SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)", #SCSI硬盘
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": "Virtual disk", #类型是虚拟硬盘
"partitions": #磁盘分区
"sda1": #磁盘分区sda1
"holders": [],
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": [
"37907382-32f8-444c-bb05-2b1c9c26e68d"
]
,
"sectors": "1024000",
"sectorsize": 512,
"size": "500.00 MB", #分区大小
"start": "2048",
"uuid": "37907382-32f8-444c-bb05-2b1c9c26e68d"
,
"sda2": #磁盘分区sda2
"holders": [
"VolGroup-lv_root",
"VolGroup-lv_swap"
],
"links":
"ids": [],
"labels": [],
"masters": [
"dm-0",
"dm-1"
],
"uuids": []
,
"sectors": "82860032",
"sectorsize": 512,
"size": "39.51 GB", #分区大小
"start": "1026048",
"uuid": null

,
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "cfq",
"sectors": "83886080",
"sectorsize": "512",
"size": "40.00 GB", #sda磁盘整体大小
"support_discard": "0",
"vendor": "VMware",
"virtual": 1
,
"sr0":
"holders": [],
"host": "IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)",
"links":
"ids": [],
"labels": [],
"masters": [],
"uuids": []
,
"model": "VMware IDE CDR00",
"partitions": ,
"removable": "1",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "cfq",
"sectors": "2097151",
"sectorsize": "512",
"size": "1024.00 MB",
"support_discard": "0",
"vendor": "NECVMWar",
"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": "6",
"ansible_distribution_release": "Final", #版本号
"ansible_distribution_version": "6.5", #版本号
"ansible_dns":
"nameservers": [
"114.114.114.114", #DNS设置
"10.1.20.10"
]
,
"ansible_domain": "localdomain", #域名
"ansible_effective_group_id": 0,
"ansible_effective_user_id": 0,
"ansible_env": #下面是系统的环境变量
"CVS_RSH": "ssh",
"G_BROKEN_FILENAMES": "1",
"HOME": "/root",
"LANG": "zh_CN.UTF-8",
"LESSOPEN": "|/usr/bin/lesspipe.sh %s",
"LOGNAME": "root",
"MAIL": "/var/mail/root",
"PATH": "/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin",
"PWD": "/root",
"QTDIR": "/usr/lib64/qt-3.3",
"QTINC": "/usr/lib64/qt-3.3/include",
"QTLIB": "/usr/lib64/qt-3.3/lib",
"SHELL": "/bin/bash",
"SHLVL": "2",
"SSH_ASKPASS": "/usr/libexec/openssh/gnome-ssh-askpass",
"SSH_CLIENT": "10.1.50.1 55018 22",
"SSH_CONNECTION": "10.1.50.1 55018 10.1.1.76 22",
"SSHTTY": "/dev/pts/1",
"TERM": "xterm-256color",
"USER": "root",
"
": "/usr/bin/python"
,
"ansible_eth0": #网卡eth0
"active": true,
"device": "eth0",
"features":
"generic_receive_offload": "off",
"generic_segmentation_offload": "on",
"large_receive_offload": "on",
"ntuple_filters": "off",
"receive_hashing": "on",
"rx_checksumming": "on",
"rx_vlan_offload": "on",
"scatter_gather": "on",
"tcp_segmentation_offload": "on",
"tx_checksumming": "on",
"tx_vlan_offload": "on",
"udp_fragmentation_offload": "off"
,
"hw_timestamp_filters": [],
"ipv4":
"address": "10.1.1.76", #IP地址
"broadcast": "10.1.255.255",
"netmask": "255.255.0.0",
"network": "10.1.0.0"
,
"ipv6": [

"address": "fe80::250:56ff:feb6:c581",
"prefix": "64",
"scope": "link"

],
"macaddress": "00:50:56:b6:c5:81",
"module": "vmxnet3",
"mtu": 1500,
"pciid": "0000:03:00.0",
"promisc": false,
"speed": 10000, #网卡速率:千兆网卡
"timestamping": [
"rx_software",
"software"
],
"type": "ether" #以太网卡
,
"ansible_fips": false,
"ansible_form_factor": "Other",
"ansible_fqdn": "localhost.localdomain",
"ansible_hostname": "localhost",
"ansible_interfaces": [
"lo",
"eth0"
],
"ansible_is_chroot": false,
"ansible_iscsi_iqn": "",
"ansible_kernel": "2.6.32-431.el6.x86_64", #系统内核版本
"ansible_lo":
"active": true,
"device": "lo",
"features":
"generic_receive_offload": "off",
"generic_segmentation_offload": "on",
"large_receive_offload": "off",
"ntuple_filters": "off",
"receive_hashing": "off",
"rx_checksumming": "on",
"rx_vlan_offload": "off",
"scatter_gather": "on",
"tcp_segmentation_offload": "off",
"tx_checksumming": "on",
"tx_vlan_offload": "off",
"udp_fragmentation_offload": "off"
,
"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": 16436,
"promisc": false,
"timestamping": [
"rx_software",
"software"
],
"type": "loopback"
,
"ansible_local": ,
"ansible_lsb":
"codename": "Final",
"description": "CentOS release 6.5 (Final)", #操作系统版本
"id": "CentOS",
"major_release": "6",
"release": "6.5"
,
"ansible_lvm":
"lvs":
"lv_root": #逻辑卷
"size_g": "35.63", #大小
"vg": "VolGroup" #属于那个卷组
,
"lv_swap": #逻辑卷
"size_g": "3.88", #大小
"vg": "VolGroup" #属于那个卷组

,
"pvs":
"/dev/sda2": #物理磁盘分区sda2
"free_g": "0",
"size_g": "39.51", #大小
"vg": "VolGroup" #为那个卷组提供空间

,
"vgs":
"VolGroup": #逻辑卷组
"free_g": "0",
"num_lvs": "2",
"num_pvs": "1",
"size_g": "39.51" #大小


,
"ansible_machine": "x86_64",
"ansible_machine_id": "025b4a571952d9e659802a6f00000018",
"ansible_memfree_mb": 3231,
"ansible_memory_mb":
"nocache":
"free": 3585,
"used": 233
,
"real":
"free": 3231,
"total": 3818,
"used": 587
,
"swap":
"cached": 0,
"free": 3967,
"total": 3967,
"used": 0

,
"ansible_memtotal_mb": 3818,
"ansible_mounts": [ #文件系统挂载

"block_available": 7710786,
"block_size": 4096,
"block_total": 9194162,
"block_used": 1483376,
"device": "/dev/mapper/VolGroup-lv_root", #挂在那个设备上
"fstype": "ext4", #文件系统类型
"inode_available": 2230976,
"inode_total": 2338336,
"inode_used": 107360,
"mount": "/", #挂载点
"options": "rw",
"size_available": 31583379456,
"size_total": 37659287552, #文件系统大小
"uuid": "0ecd4fa7-a6fd-49f3-ab4f-ff10acc426b0"
,

"block_available": 430347,
"block_size": 1024,
"block_total": 495844,
"block_used": 65497,
"device": "/dev/sda1", #挂在那个设备上
"fstype": "ext4", #文件系统类型
"inode_available": 127977,
"inode_total": 128016,
"inode_used": 39,
"mount": "/boot", #挂载点
"options": "rw",
"size_available": 440675328,
"size_total": 507744256, #大小
"uuid": "37907382-32f8-444c-bb05-2b1c9c26e68d"

],
"ansible_nodename": "localhost.localdomain", #主机名
"ansible_os_family": "RedHat",
"ansible_pkg_mgr": "yum",
"ansible_processor": [ #运行虚拟机的CPU情况
"0",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz",
"1",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz",
"2",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz",
"3",
"GenuineIntel",
"Intel(R) Xeon(R) CPU E5-2603 v3 @ 1.60GHz"
],
"ansible_processor_cores": 4,
"ansible_processor_count": 1,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 4, #虚拟机是4vcpu
"ansible_product_name": "VMware Virtual Platform",
"ansible_product_serial": "VMware-42 36 8d 53 a0 37 9a 8f-e0 46 d1 36 f4 a7 30 02",
"ansible_product_uuid": "42368D53-A037-9A8F-E046-D136F4A73002",
"ansible_product_version": "None",
"ansible_python":
"executable": "/usr/bin/python",
"has_sslcontext": false,
"type": "CPython",
"version":
"major": 2,
"micro": 6,
"minor": 6,
"releaselevel": "final",
"serial": 0
,
"version_info": [
2,
6,
6,
"final",
0
]
,
"ansible_python_version": "2.6.6", #python版本
"ansible_real_group_id": 0,
"ansible_real_user_id": 0,
"ansible_selinux":
"status": "disabled"
,
"ansible_selinux_python_present": true, #selinux设置
"ansible_service_mgr": "upstart",
"ansible_ssh_host_key_dsa_public": "AAAAB3NzaC1kc3MAAACBAKAQdjweEMgrY9Y4YBfBhVJfIfLfzC5AQ52xwQRNxDlK5NnElf0InAjL62s60B2uHZe9FuTyeC9Vre8dSkYlkEjnbIhmLiYpbbUr45L4Ua/WuGQLa/Yny0nuXVvVKX6QZ8P6Vdz+t5s+cj7F4z1dfoLD0X1pQwlZWyMBERmvYy1BAAAAFQCYJH/HLh3WLzGUaxq0tK3WYO0fKQAAAIAFaTLbN/DhfETHQxE53KAt2yOxj7WGP2W9WapO5iAvu1VrbQVdk5FvtErqL4XdHhXp11il59YsAqmZNwErGwOiWd7XKrypQaHHla1UMTP4I95jMzU9MoeFGa94Idc9oVAQ8mkowXsDi5B52VM0SNXDE1IOQx+zM7t78CC74ob6tQAAAIBBY00a0gSvVsBNEoVC2HVTAwxl+7Ps+rBGQKIVStRpKkJkcdp/2bu1HCu4q8VPQ584/UJdca/1QnrBluCS8kdXkvALhwofFCXAv/UjNLbid/BiAbRffMjfNw0SS8xs/yke//66PIVmpcXhd8gbV9K7NhETG3MRm0M6zXcPxcjpAQ==",
"ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAABIwAAAQEAtlRzXU4cBd+TT26Nz3UMLjat3K7p2pKU+gntWHHSY2oX7KaX58Gl8y9OgEOicL9dqh7Y5fn/YEiEX/A/x4ZAgCveZBX9Qf259xVIw52FmPgszIRc8ymFhBxEbJDfTKKn2jNb+0SzzNseaPhCJUcNRej+FCnDuRKLZYexipQDVFHJBkON0NWg0VKTZpNgDyPbSsYg0Gf2EGhZi+g/snV0Q8Q3n9kI9dHK9xCdS4cBYM8acZoOJP/ybi1dwUZd62lf8bKItACkW0AvL7CpHXfPIL7s8uz88zkJBmHXmLSiTbwH1cZoP5kT1TG5JqN34aFiWvlkpw11s/6gDdd3S7PKmQ==",
"ansible_swapfree_mb": 3967,
"ansible_swaptotal_mb": 3967,
"ansible_system": "Linux",
"ansible_system_capabilities": [],
"ansible_system_capabilities_enforced": "False",
"ansible_system_vendor": "VMware, Inc.", #机器的提供商
"ansible_uptime_seconds": 851823,
"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_virtualization_role": "guest",
"ansible_virtualization_type": "VMware",
"gather_subset": [
"all"
],
"module_setup": true
,
"changed": false

以上是关于CMDB与自动化部署的联动的主要内容,如果未能解决你的问题,请参考以下文章

CMDB和运维自动化

cmdb简介和入门

CMDB机柜平台结合zabbix告警展示

优云CMDB专家实践谈:自动化运维的基石CMDB

ansible总结

云管平台与CMDB的联动