# ansible host(192.168.56.53) -m setup > SetupModulInfo.txt
엔서블로 yml 스크립트 작성시 필요한 각종 함수(Module) 정보를 출력함
아래 yml 파일은 os가 CentOS 또는 Ubuntu 종류에 따라 nginx를 설치하는 yml 파일임 ( 출처 sysnet4admin )
--- - name: Install nginx on the nodes hosts: nodes (192.168.56.53) become: yes tasks: - name: install epel-release for CentOS action: "{{ ansible_pkg_mgr }} name=epel-release state=latest" when: ansible_distribution == 'CentOS' - name: install nginx web server for CentOS action: "{{ ansible_pkg_mgr }} name=nginx state=present" when: ansible_distribution == 'CentOS' - name: upload default index.html for web server get_url: url=https://www.nginx.com dest=/usr/share/nginx/html/ mode=0644 when: ansible_distribution == 'CentOS' - name: start nginx web server service: name=nginx state=started when: ansible_distribution == 'CentOS' - name: install nginx web server for Ubuntu action: "{{ ansible_pkg_mgr }} name=nginx state=present update_cache=yes" when: ansible_distribution == 'Ubuntu' - name: upload default index.html for web server get_url: url=https://www.nginx.com dest=/usr/share/nginx/html/ mode=0644 validate_certs=no when: ansible_distribution == 'Ubuntu' |
# ansible 192.168.56.53 -m setup > 53.txt * 아래는 53.txt 파일에 대한 출력 결과물이다.
192.168.56.53 | SUCCESS => {
"ansible_facts": {
"ansible_all_ipv4_addresses": [
"192.168.56.53",
"10.0.2.15"
],
"ansible_all_ipv6_addresses": [
"fe80::a00:27ff:feaf:60e0",
"fe80::5054:ff:fe4d:77d3"
],
"ansible_apparmor": {
"status": "disabled"
},
"ansible_architecture": "x86_64",
"ansible_bios_date": "12/01/2006",
"ansible_bios_version": "VirtualBox",
"ansible_cmdline": {
"BOOT_IMAGE": "/boot/vmlinuz-3.10.0-1127.el7.x86_64",
"LANG": "en_US.UTF-8",
"biosdevname": "0",
"console": "ttyS0,115200n8",
"crashkernel": "auto",
"elevator": "noop",
"net.ifnames": "0",
"no_timer_check": true,
"ro": true,
"root": "UUID=1c419d6c-5064-4a2b-953c-05b2c67edb15"
},
"ansible_date_time": {
"date": "2023-03-19",
"day": "19",
"epoch": "1679199226",
"hour": "04",
"iso8601": "2023-03-19T04:13:46Z",
"iso8601_basic": "20230319T041346239496",
"iso8601_basic_short": "20230319T041346",
"iso8601_micro": "2023-03-19T04:13:46.239496Z",
"minute": "13",
"month": "03",
"second": "46",
"time": "04:13:46",
"tz": "UTC",
"tz_offset": "+0000",
"weekday": "Sunday",
"weekday_number": "0",
"weeknumber": "11",
"year": "2023"
},
"ansible_default_ipv4": {
"address": "10.0.2.15",
"alias": "eth0",
"broadcast": "10.0.2.255",
"gateway": "10.0.2.2",
"interface": "eth0",
"macaddress": "52:54:00:4d:77:d3",
"mtu": 1500,
"netmask": "255.255.255.0",
"network": "10.0.2.0",
"type": "ether"
},
"ansible_default_ipv6": {},
"ansible_device_links": {
"ids": {
"sda": [
"ata-VBOX_HARDDISK_VB7426d174-3fc9655d"
],
"sda1": [
"ata-VBOX_HARDDISK_VB7426d174-3fc9655d-part1"
]
},
"labels": {},
"masters": {},
"uuids": {
"sda1": [
"1c419d6c-5064-4a2b-953c-05b2c67edb15"
]
}
},
"ansible_devices": {
"sda": {
"holders": [],
"host": "IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)",
"links": {
"ids": [
"ata-VBOX_HARDDISK_VB7426d174-3fc9655d"
],
"labels": [],
"masters": [],
"uuids": []
},
"model": "VBOX HARDDISK",
"partitions": {
"sda1": {
"holders": [],
"links": {
"ids": [
"ata-VBOX_HARDDISK_VB7426d174-3fc9655d-part1"
],
"labels": [],
"masters": [],
"uuids": [
"1c419d6c-5064-4a2b-953c-05b2c67edb15"
]
},
"sectors": "83884032",
"sectorsize": 512,
"size": "40.00 GB",
"start": "2048",
"uuid": "1c419d6c-5064-4a2b-953c-05b2c67edb15"
}
},
"removable": "0",
"rotational": "1",
"sas_address": null,
"sas_device_handle": null,
"scheduler_mode": "noop",
"sectors": "83886080",
"sectorsize": "512",
"size": "40.00 GB",
"support_discard": "0",
"vendor": "ATA",
"virtual": 1
}
},
"ansible_distribution": "CentOS", # 일부 서버 셋팅에 확인 안되는 부분 있음 : "OtherLinux", "N/A" 등
"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.9",
"ansible_dns": {
"nameservers": [
"10.0.2.3"
]
},
"ansible_domain": "",
"ansible_effective_group_id": 1000,
"ansible_effective_user_id": 1000,
"ansible_env": {
"HOME": "/home/vagrant",
"LANG": "en_US.UTF-8",
"LESSOPEN": "||/usr/bin/lesspipe.sh %s",
"LOGNAME": "vagrant",
"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/vagrant",
"PATH": "/usr/local/bin:/usr/bin",
"PWD": "/home/vagrant",
"SELINUX_LEVEL_REQUESTED": "",
"SELINUX_ROLE_REQUESTED": "",
"SELINUX_USE_CURRENT_RANGE": "",
"SHELL": "/bin/bash",
"SHLVL": "2",
"SSH_CLIENT": "192.168.56.50 50676 22",
"SSH_CONNECTION": "192.168.56.50 50676 192.168.56.53 22",
"SSH_TTY": "/dev/pts/1",
"TERM": "xterm",
"USER": "vagrant",
"XDG_RUNTIME_DIR": "/run/user/1000",
"XDG_SESSION_ID": "8",
"_": "/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": "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",
"rx_checksumming": "off",
"rx_fcs": "off",
"rx_gro_hw": "off [fixed]",
"rx_udp_tunnel_port_offload": "off [fixed]",
"rx_vlan_filter": "on [fixed]",
"rx_vlan_offload": "on",
"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": "off [fixed]",
"tx_tcp_ecn_segmentation": "off [fixed]",
"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": "on [fixed]",
"tx_vlan_stag_hw_insert": "off [fixed]",
"udp_fragmentation_offload": "off [fixed]",
"vlan_challenged": "off [fixed]"
},
"hw_timestamp_filters": [],
"ipv4": {
"address": "10.0.2.15",
"broadcast": "10.0.2.255",
"netmask": "255.255.255.0",
"network": "10.0.2.0"
},
"ipv6": [
{
"address": "fe80::5054:ff:fe4d:77d3",
"prefix": "64",
"scope": "link"
}
],
"macaddress": "52:54:00:4d:77:d3",
"module": "e1000",
"mtu": 1500,
"pciid": "0000:00:03.0",
"promisc": false,
"speed": 1000,
"timestamping": [
"tx_software",
"rx_software",
"software"
],
"type": "ether"
},
"ansible_eth1": {
"active": true,
"device": "eth1",
"features": {
"busy_poll": "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",
"rx_checksumming": "off",
"rx_fcs": "off",
"rx_gro_hw": "off [fixed]",
"rx_udp_tunnel_port_offload": "off [fixed]",
"rx_vlan_filter": "on [fixed]",
"rx_vlan_offload": "on",
"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": "off [fixed]",
"tx_tcp_ecn_segmentation": "off [fixed]",
"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": "on [fixed]",
"tx_vlan_stag_hw_insert": "off [fixed]",
"udp_fragmentation_offload": "off [fixed]",
"vlan_challenged": "off [fixed]"
},
"hw_timestamp_filters": [],
"ipv4": {
"address": "192.168.56.53",
"broadcast": "192.168.56.255",
"netmask": "255.255.255.0",
"network": "192.168.56.0"
},
"ipv6": [
{
"address": "fe80::a00:27ff:feaf:60e0",
"prefix": "64",
"scope": "link"
}
],
"macaddress": "08:00:27:af:60:e0",
"module": "e1000",
"mtu": 1500,
"pciid": "0000:00:08.0",
"promisc": false,
"speed": 1000,
"timestamping": [
"tx_software",
"rx_software",
"software"
],
"type": "ether"
},
"ansible_fibre_channel_wwn": [],
"ansible_fips": false,
"ansible_form_factor": "Other",
"ansible_fqdn": "ansible-node03",
"ansible_hostname": "ansible-node03",
"ansible_hostnqn": "",
"ansible_interfaces": [
"lo",
"eth1",
"eth0"
],
"ansible_is_chroot": true,
"ansible_iscsi_iqn": "",
"ansible_kernel": "3.10.0-1127.el7.x86_64",
"ansible_kernel_version": "#1 SMP Tue Mar 31 23:36:51 UTC 2020",
"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": "",
"netmask": "255.0.0.0",
"network": "127.0.0.0"
},
"ipv6": [
{
"address": "::1",
"prefix": "128",
"scope": "host"
}
],
"mtu": 65536,
"promisc": false,
"timestamping": [
"rx_software",
"software"
],
"type": "loopback"
},
"ansible_local": {},
"ansible_lsb": {},
"ansible_machine": "x86_64",
"ansible_machine_id": "4b38f45955af66429a6e7e9040f9a362",
"ansible_memfree_mb": 176,
"ansible_memory_mb": {
"nocache": {
"free": 362,
"used": 124
},
"real": {
"free": 176,
"total": 486,
"used": 310
},
"swap": {
"cached": 0,
"free": 2046,
"total": 2047,
"used": 1
}
},
"ansible_memtotal_mb": 486,
"ansible_mounts": [
{
"block_available": 9623569,
"block_size": 4096,
"block_total": 10480385,
"block_used": 856816,
"device": "/dev/sda1",
"fstype": "xfs",
"inode_available": 20939939,
"inode_total": 20971008,
"inode_used": 31069,
"mount": "/",
"options": "rw,seclabel,relatime,attr2,inode64,noquota",
"size_available": 39418138624,
"size_total": 42927656960,
"uuid": "1c419d6c-5064-4a2b-953c-05b2c67edb15"
}
],
"ansible_nodename": "ansible-node03",
"ansible_os_family": "RedHat",
"ansible_pkg_mgr": "yum",
"ansible_proc_cmdline": {
"BOOT_IMAGE": "/boot/vmlinuz-3.10.0-1127.el7.x86_64",
"LANG": "en_US.UTF-8",
"biosdevname": "0",
"console": [
"tty0",
"ttyS0,115200n8"
],
"crashkernel": "auto",
"elevator": "noop",
"net.ifnames": "0",
"no_timer_check": true,
"ro": true,
"root": "UUID=1c419d6c-5064-4a2b-953c-05b2c67edb15"
},
"ansible_processor": [
"0",
"GenuineIntel",
"Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz"
],
"ansible_processor_cores": 1,
"ansible_processor_count": 1,
"ansible_processor_threads_per_core": 1,
"ansible_processor_vcpus": 1,
"ansible_product_name": "VirtualBox",
"ansible_product_serial": "NA",
"ansible_product_uuid": "NA",
"ansible_product_version": "1.2",
"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": 1000,
"ansible_real_user_id": 1000,
"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": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEFLGbE+UjrBCTJzGQGQpJuWBHpjc5kxfSCmRrxHYXo1XqtHT11huXegxPSdCtev4MV9UtNGS5SSOrFyM46uubc=",
"ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIKZDZmJ30g1NEYAiVNFV5IJiRD7iiujBRAkrFMZ8W/8j",
"ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDAY5gSpWQ89ELcY2Yszi2y7YKESZEjvV6vJqp1jXSOSynDIGJl4wUVHGYLG4Ukj8KmDfeoB5suN/Fuh/APTVFQSb8Nc3DzLDNcChzdZVegcS1RiWf2hUjihqgPlhfl3s0Utgros+Z3AwstQwem/R3GTIJffj2Cj8kALsrYy4fmqEFNUT8dCvZKPpKVYNRs9ZtBI0O0YYkIHfJREmcK1ecQqRR+KEvC/pOG9o4Uj3w1cBQndGTjyii4G7ESx8X77p/ML8nb7G84OIVtKP8TqvftaDPPPfHsnzVHzk6LzRGkbLQDsaZeOGEe+UAYzbsyAS3Wyqbox0q18Kitlvb+u5Rx",
"ansible_swapfree_mb": 2046,
"ansible_swaptotal_mb": 2047,
"ansible_system": "Linux",
"ansible_system_capabilities": [
""
],
"ansible_system_capabilities_enforced": "True",
"ansible_system_vendor": "innotek GmbH",
"ansible_uptime_seconds": 973,
"ansible_user_dir": "/home/vagrant",
"ansible_user_gecos": "vagrant",
"ansible_user_gid": 1000,
"ansible_user_id": "vagrant",
"ansible_user_shell": "/bin/bash",
"ansible_user_uid": 1000,
"ansible_userspace_architecture": "x86_64",
"ansible_userspace_bits": "64",
"ansible_virtualization_role": "guest",
"ansible_virtualization_type": "virtualbox",
"gather_subset": [
"all"
],
"module_setup": true
},
"changed": false
}
'IT관리' 카테고리의 다른 글
ubuntu(우분투) 14.04 to 16.04 to 18.04 업그레이드 (0) | 2023.12.17 |
---|---|
전자정부 누리집 (1) | 2023.12.05 |
open ko-llm 리더보드 사이트 입니다. (0) | 2023.11.18 |
Linux, Docker, etc command (0) | 2023.11.18 |
쿠버네티스(kubernetes) ICON (0) | 2023.11.18 |