Ansibleについて
Ansibleはミドルウェアのインストールやアプリケーションのデプロイなど、対象サーバ群に対して、一定の処理を行える製品である。
構成
Ansibleをインストールしたサーバと、Ansibleの処理対象の複数のサーバが存在する。
AnsibleサーバではAnsibleが動作するが、処理対象のサーバではpythonさえインストールされていればよい。
用語
Role
Ansibleで実行する処理単位に分けられたファイル群のことである。
例えば、「~~のインストール」のRoleというように作成される。
通常、配布単位もRole毎に行われる。
Playbook
処理の内容を記述した設定ファイルである。
ただし、実際のコマンドレベルでの処理は記述せず、Moduleの呼び出しを使用して記述する。
Module
「ファイルのコピー」や「所有者の変更」など、最小単位の処理を担当するAnsibleのライブラリである。
単に一行のコマンドというわけではなく、何度実行しても同じ結果になるよう、環境調査や実行、例外処理などを内部で行っている。
Inventory
Ansibleで操作を行う対象サーバの一覧を記述したファイルである。
単純にホスト名を羅列して記述もできるが、ホスト個別に接続ユーザ名やポート番号の指定なども行える。
構築
Pythonは標準でインストールされているので、Ansibleのみインストールする。
- pipのインストール
easy_install pip
- ansibleのインストール
- 最新版をインストールする
pip install ansible
- 特定バージョンをインストールする
pip install ansible==2.4.2.0
- 最新版をインストールする
- 正常にインストールされたことを確認する
ansible localhost -m ping
「localhost | SUCCESS」と表示されたら動作している - 設定ファイルを作成する
mkdir /etc/ansible cat > /etc/ansible/ansible.cfg << EOT [defaults] host_key_checking = False EOT
設定
ツール
ansible
- 基本書式
ansible <グループ名> -i <Inventoryファイルパス> -m <実行モジュール>
ansible-config
ansible-connection
ansible-console
ansible-doc
ansible-galaxy
ansible-inventory
ansible-playbook
プレイブックを実行し、対象ホストにタスクを実行する
参考:https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html
- 書式
ansible-playbook [<オプション>] <プレイブック> […] - オプション
- -i or –inventory
インベントリのファイルを指定する
- -i or –inventory
ansible-pull
ansible-vault
Playbookの設定
トップレベル設定
become
特定ユーザでリモート処理を実行するかどうか。
デフォルトではrootであるが、become_userディレクティブによる別のユーザを指定することも可能。
特定ユーザの実行ではsudoが使用される。suを使用する場合はbecome_methodディレクティブの変更が必要。
- 書式
become: { true | false }
become_method
- 書式
become_method: { sudo | su }
モジュール
ファイルコピー
https://docs.ansible.com/ansible/latest/modules/copy_module.html#copy-module
- 書式
tasks: - name: <タスク名> copy: src: <コピー元ファイル> dest: <コピー先ファイル>
複数のファイルをコピーする場合、タスクを複数定義するか、次のように記述することもできる。
※src/destのパスを書かずに、with_itemsでフルパスで記述しても良い。
- hosts: all
tasks:
- name: <タスク名>
copy:
src: /<パス>/{{ item }}
dest: /<パス>/{{ item }}
with_items:
- "<ファイル名1>"
- "<ファイル名2>"
- "<ファイル名3>"
ファイル操作
ファイルの権限変更や削除、リンク作成などを行える。
https://docs.ansible.com/ansible/latest/modules/file_module.html
ファイル削除
- hosts: all
tasks:
- name: <タスク名>
file:
state: absent
path: {{ item }}
with_items:
- "<ファイルパス1>"
- "<ファイルパス2>"
yum
yumを使用したパッケージ操作。
ローカルのrpmのインストールも同様の方法でできる。
- 書式
- インターネットのリポジトリからインストール
- hosts: all
tasks:
- name: <タスク名>
become: yes
yum:
name: <パッケージ名>
state: present - ローカルインストール
- hosts: all
tasks:
- name: <タスク名>
become: yes
yum:
name: /<パス>/{{ item }}
state: present
with_items:
- "AAA.rpm"
- "BBB.rpm"
- インターネットのリポジトリからインストール
systemd
- サービスの有効化
- hosts: all
tasks:
- name: <タスク名> systemd: name: "{{ item }}" enabled: yes with_items: - "AAA.service" - "BBB.service"
運用
Playbookの使用
Hello World
インストール直後の初期状態で、Hello World的サンプルを作成して実行する
このPlaybookではリモートホストのSSHログインにパスワード方式を使用しているが、パスワード方式の場合、「sshpass」パッケージが必要となる。
yum install sshpass -y
- Inventoryの作成
cat > /etc/ansible/inventory-test << EOT localhost ansible_ssh_user=root ansible_ssh_pass=<パスワード> ansible_sudo_pass=<パスワード> 127.0.0.1 ansible_ssh_user=root ansible_ssh_pass=<パスワード> ansible_sudo_pass=<パスワード> EOT
- Playbookの作成
cat > /etc/ansible/play-test-hello.yml << EOT - hosts: all tasks: - shell: echo Hello \`hostname\` > /tmp/ansibletest.\`hostname\` EOT
- 実行
ansible-playbook -i /etc/ansible/inventory-test /etc/ansible/play-test-hello.yml
or
mv /etc/ansible/ ansible-playbook -i inventory-test play-test-hello.yml
- 確認
ファイルが二つできているはずである
ll /tmp/ansibletest*
ファイル転送
インストール直後の初期状態で、Hello World的サンプルを作成して実行する
このPlaybookではリモートホストのSSHログインにパスワード方式を使用しているが、パスワード方式の場合、「sshpass」パッケージが必要となる。
yum install sshpass -y
- Inventoryの作成
cat > /etc/ansible/inventory-test << EOT localhost ansible_ssh_user=root ansible_ssh_pass=<パスワード> ansible_sudo_pass=<パスワード> EOT
- Playbookの作成
nameは必須である
cat > /etc/ansible/play-test-copy.yml << EOT - hosts: all tasks: - name: copy_test copy: src: /etc/ansible/play-test-copy.yml dest: ~/play-test-copy.yml.copy EOT
- 実行
ansible-playbook -i /etc/ansible/inventory-test /etc/ansible/play-test-copy.yml
or
mv /etc/ansible/ ansible-playbook -i inventory-test play-test-copy.yml
- 確認
ファイルが1つできているはずである
ll ~/play-test-copy.yml.copy diff ~/play-test-copy.yml.copy /etc/ansible/play-test-copy.yml rm -f ~/play-test-copy.yml.copy
情報収集
各サーバに対し、情報収集を行える。
暗黙的に情報収集は常に実行されるので、ここで取得した値はPlaybookの中で利用できる。
ansible all -i <Inventoryファイルパス> -m setup
この情報収集を無効化する場合は次の設定をトップレベルに入れる必要がある。
Pythonがインストールされていない環境を対象とする場合は入れておいた方がよい。
gather_facts: false
- 例
- hosts: all gather_facts: false tasks: ~~~
- 実行例
localhost | SUCCESS => { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.203.129" ], "ansible_all_ipv6_addresses": [ "fe80::6006:cc4a:a536:8ef9" ], "ansible_apparmor": { "status": "disabled" }, "ansible_architecture": "x86_64", "ansible_bios_date": "05/19/2017", "ansible_bios_version": "6.00", "ansible_cmdline": { "BOOT_IMAGE": "/vmlinuz-3.10.0-862.11.6.el7.x86_64", "LANG": "en_US.UTF-8", "crashkernel": "auto", "quiet": true, "rd.lvm.lv": "centos/swap", "rhgb": true, "ro": true, "root": "/dev/mapper/centos-root" }, "ansible_date_time": { "date": "2018-09-19", "day": "19", "epoch": "1537359586", "hour": "12", "iso8601": "2018-09-19T12:19:46Z", "iso8601_basic": "20180919T121946549382", "iso8601_basic_short": "20180919T121946", "iso8601_micro": "2018-09-19T12:19:46.549457Z", "minute": "19", "month": "09", "second": "46", "time": "12:19:46", "tz": "UTC", "tz_offset": "+0000", "weekday": "Wednesday", "weekday_number": "3", "weeknumber": "38", "year": "2018" }, "ansible_default_ipv4": { "address": "192.168.203.129", "alias": "ens33", "broadcast": "192.168.203.255", "gateway": "192.168.203.2", "interface": "ens33", "macaddress": "00:0c:29:12:56:34", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.203.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_device_links": { "ids": { "dm-0": [ "dm-name-centos-root", "dm-uuid-LVM-hE5K28kSEozRVDLXIuQAWSOydKZuPm00ShLAV3cD703Ozqsgq5GkaV51ucBeBtmx" ], "dm-1": [ "dm-name-centos-swap", "dm-uuid-LVM-hE5K28kSEozRVDLXIuQAWSOydKZuPm000uYTVZjuk1T1j4x2zA2yC101gUdnAoWz" ], "sda2": [ "lvm-pv-uuid-hb8U6d-c084-dwBu-J6SX-9v8t-D6DD-3hQlp2" ], "sr0": [ "ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001" ] }, "labels": {}, "masters": { "sda2": [ "dm-0", "dm-1" ] }, "uuids": { "dm-0": [ "ca0568a0-3e1e-462d-8bd7-7134abe538a9" ], "dm-1": [ "8d7784b0-64ec-4cbd-9ad2-5756c135896b" ], "sda1": [ "d94b9abb-c06f-4deb-991f-a8dad9ba4fd1" ] } }, "ansible_devices": { "dm-0": { "holders": [], "host": "", "links": { "ids": [ "dm-name-centos-root", "dm-uuid-LVM-hE5K28kSEozRVDLXIuQAWSOydKZuPm00ShLAV3cD703Ozqsgq5GkaV51ucBeBtmx" ], "labels": [], "masters": [], "uuids": [ "ca0568a0-3e1e-462d-8bd7-7134abe538a9" ] }, "model": null, "partitions": {}, "removable": "0", "rotational": "1", "sas_address": null, "sas_device_handle": null, "scheduler_mode": "", "sectors": "16769024", "sectorsize": "512", "size": "8.00 GB", "support_discard": "0", "vendor": null, "virtual": 1 }, "dm-1": { "holders": [], "host": "", "links": { "ids": [ "dm-name-centos-swap", "dm-uuid-LVM-hE5K28kSEozRVDLXIuQAWSOydKZuPm000uYTVZjuk1T1j4x2zA2yC101gUdnAoWz" ], "labels": [], "masters": [], "uuids": [ "8d7784b0-64ec-4cbd-9ad2-5756c135896b" ] }, "model": null, "partitions": {}, "removable": "0", "rotational": "1", "sas_address": null, "sas_device_handle": null, "scheduler_mode": "", "sectors": "2097152", "sectorsize": "512", "size": "1.00 GB", "support_discard": "0", "vendor": null, "virtual": 1 }, "sda": { "holders": [], "host": "", "links": { "ids": [], "labels": [], "masters": [], "uuids": [] }, "model": "VMware Virtual S", "partitions": { "sda1": { "holders": [], "links": { "ids": [], "labels": [], "masters": [], "uuids": [ "d94b9abb-c06f-4deb-991f-a8dad9ba4fd1" ] }, "sectors": "2097152", "sectorsize": 512, "size": "1.00 GB", "start": "2048", "uuid": "d94b9abb-c06f-4deb-991f-a8dad9ba4fd1" }, "sda2": { "holders": [ "centos-root", "centos-swap" ], "links": { "ids": [ "lvm-pv-uuid-hb8U6d-c084-dwBu-J6SX-9v8t-D6DD-3hQlp2" ], "labels": [], "masters": [ "dm-0", "dm-1" ], "uuids": [] }, "sectors": "18872320", "sectorsize": 512, "size": "9.00 GB", "start": "2099200", "uuid": null } }, "removable": "0", "rotational": "1", "sas_address": null, "sas_device_handle": null, "scheduler_mode": "deadline", "sectors": "20971520", "sectorsize": "512", "size": "10.00 GB", "support_discard": "0", "vendor": "VMware,", "virtual": 1 }, "sr0": { "holders": [], "host": "", "links": { "ids": [ "ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001" ], "labels": [], "masters": [], "uuids": [] }, "model": "VMware IDE CDR10", "partitions": {}, "removable": "1", "rotational": "1", "sas_address": null, "sas_device_handle": null, "scheduler_mode": "deadline", "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": "7", "ansible_distribution_release": "Core", "ansible_distribution_version": "7.5.1804", "ansible_dns": { "nameservers": [ "192.168.203.2" ], "search": [ "localdomain", "corp" ] }, "ansible_domain": "corp", "ansible_effective_group_id": 0, "ansible_effective_user_id": 0, "ansible_ens33": { "active": true, "device": "ens33", "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_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.203.129", "broadcast": "192.168.203.255", "netmask": "255.255.255.0", "network": "192.168.203.0" }, "ipv6": [ { "address": "fe80::6006:cc4a:a536:8ef9", "prefix": "64", "scope": "link" } ], "macaddress": "00:0c:29:12:56:34", "module": "e1000", "mtu": 1500, "pciid": "0000:02:01.0", "promisc": false, "speed": 1000, "timestamping": [ "tx_software", "rx_software", "software" ], "type": "ether" }, "ansible_env": { "APACHE_HOME": "/usr/local/apache", "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:*.l h=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=0 ;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=0 ;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:*. vgz=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; 5:*.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=0 ;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=0 ;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",
1 "MARIADB_DATA": "/usr/local/data/mariadb",
1 "MARIADB_HOME": "/usr/local/mariadb",
3 "PATH": "/usr/local/php/bin:/usr/local/php/sbin:/usr/local/zabbix/bin:/usr/local/zabbix/sbin:/usr/local/apache/bin:/usr/local/apa he/sbin:/usr/local/mariadb/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin",
c "PHP_HOME": "/usr/local/php",
s "PROXY_TARGET": "tkyproxy.intra.tis.co.jp:8080",
= "PWD": "/root",
1 "SELINUX_LEVEL_REQUESTED": "",
1 "SELINUX_ROLE_REQUESTED": "",
z "SELINUX_USE_CURRENT_RANGE": "",
: "SHELL": "/bin/bash",
"SHLVL": "2", "SSH_CLIENT": "::1 57782 22", "SSH_CONNECTION": "::1 57782 ::1 22", "SSH_TTY": "/dev/pts/4", "TERM": "xterm", "USER": "root", "XDG_RUNTIME_DIR": "/run/user/0", "XDG_SESSION_ID": "390", "ZABBIX_HOME": "/usr/local/zabbix", "_": "/usr/bin/python", "ftp_proxy": "ftp://tkyproxy.intra.tis.co.jp:8080", "http_proxy": "http://tkyproxy.intra.tis.co.jp:8080", "https_proxy": "https://tkyproxy.intra.tis.co.jp:8080", "no_proxy": "10.,172.16.,192.168.,.tis.co.jp,127.", "proxy": "http://tkyproxy.intra.tis.co.jp:8080" }, "ansible_fips": false, "ansible_form_factor": "Other", "ansible_fqdn": "zabbix.corp", "ansible_hostname": "zabbix", "ansible_interfaces": [ "lo", "ens33" ], "ansible_is_chroot": false, "ansible_iscsi_iqn": "", "ansible_kernel": "3.10.0-862.11.6.el7.x86_64", "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_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" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 65536, "promisc": false, "timestamping": [ "rx_software", "software" ], "type": "loopback" }, "ansible_local": {}, "ansible_lsb": {}, "ansible_lvm": { "lvs": { "root": { "size_g": "8.00", "vg": "centos" }, "swap": { "size_g": "1.00", "vg": "centos" } }, "pvs": { "/dev/sda2": { "free_g": "0", "size_g": "9.00", "vg": "centos" } }, "vgs": { "centos": { "free_g": "0", "num_lvs": "2", "num_pvs": "1", "size_g": "9.00" } } }, "ansible_machine": "x86_64", "ansible_machine_id": "f23a54e3ead4467499e0f45d13bd0f60", "ansible_memfree_mb": 108, "ansible_memory_mb": { "nocache": { "free": 265, "used": 709 }, "real": { "free": 108, "total": 974, "used": 866 }, "swap": { "cached": 5, "free": 944, "total": 1023, "used": 79 } }, "ansible_memtotal_mb": 974, "ansible_mounts": [ { "block_available": 1139418, "block_size": 4096, "block_total": 2093568, "block_used": 954150, "device": "/dev/mapper/centos-root", "fstype": "xfs", "inode_available": 4086147, "inode_total": 4192256, "inode_used": 106109, "mount": "/", "options": "rw,seclabel,relatime,attr2,inode64,noquota", "size_available": 4667056128, "size_total": 8575254528, "uuid": "ca0568a0-3e1e-462d-8bd7-7134abe538a9" }, { "block_available": 212359, "block_size": 4096, "block_total": 259584, "block_used": 47225, "device": "/dev/sda1", "fstype": "xfs", "inode_available": 523949, "inode_total": 524288, "inode_used": 339, "mount": "/boot", "options": "rw,seclabel,relatime,attr2,inode64,noquota", "size_available": 869822464, "size_total": 1063256064, "uuid": "d94b9abb-c06f-4deb-991f-a8dad9ba4fd1" } ], "ansible_nodename": "zabbix.corp", "ansible_os_family": "RedHat", "ansible_pkg_mgr": "yum", "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": "VMware Virtual Platform", "ansible_product_serial": "VMware-56 4d 44 72 f8 58 09 7d-83 8a 1f 66 47 12 56 34", "ansible_product_uuid": "72444D56-58F8-7D09-838A-1F6647125634", "ansible_product_version": "None", "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": { "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": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMUAfQLj+p2vkklsJhr5kbB8DbCgqD93sidDoioI4Zo CEvpxhJPNYwHF5DfBlXwIpcul70xMN9N7TQiwDLXrk4=", Z "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIEP5fWo6hgn6PQ5OXDhynvxWZ58kwCjy4x0uKODFmX7X",
"ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDdD8MJR6fqhvrPHdARUs+5p11CfHHPI71yv3GUJma5/AsxFgktyj2W0w+xeQ8CUXYdP bfy8tYUgGuVl6ufw4W5rRCOfMxd61DeMUdWu666Cpw9kjVTzul8sQOVFTouWgT1obHtIfxBsnGlujqgd0RB/jNQBPhysnjLUDxYsRgp/dV2VJkyeuIFNKQR8HXiP6BPp65CQNPkN3n/It wsXB6e34BnSoIb2Q3FrQ9bPkm/ropyZ9Ei7nu6puXAMruawlHHBC9RUojUCCIt05HL7pElLJlq4c54sacpOWAFskcC2SmHFT3dbYHQdXLy09GMRuyDAZEbTSj4jJIc3Y1dQT", S "ansible_swapfree_mb": 944,
9 "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", "35", "36+ep" ], "ansible_system_capabilities_enforced": "True", "ansible_system_vendor": "VMware, Inc.", "ansible_uptime_seconds": 1300775, "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 }