πŸ“œ ⬆️ ⬇️

Ansible control system



Imagine that you need to manage a fleet of servers, also located in different geographical locations. Each of these servers requires configuration, regular updates and monitoring. Of course, to solve these problems, you can use the easiest way: connect to each server via ssh and make the necessary changes. For all its simplicity, this method is fraught with some difficulties: it is extremely time-consuming, and it takes a lot of time to perform uniform operations.

To simplify the process of setting up and configuring servers, you can also write shell scripts. But this method can hardly be called perfect. Scripts need to constantly change, adjusting them for each new task. When writing them you need to take into account the difference between operating systems and versions. Let's not forget that debugging scripts takes a lot of effort and takes a lot of time.
')
The best solution to the problems described is the implementation of a remote configuration management system. In such systems, it suffices to describe the desired state of the controlled node. The system itself must determine what needs to be done to achieve this state, and carry out all the necessary actions.

With all the difficulties discussed above, we are very familiar from our own experience: we have 10 points of presence with NS servers located in different parts of the planet. They need to regularly make various changes: update the operating system, install and update various software, change the configuration, etc. We decided to automate all these operations and implement a remote configuration management system. Having studied the available solutions, we chose Ansible.

In this article, we would like to tell you in detail about its capabilities of this configuration management tool and share your own experience of using it.

What is Ansible?


Ansible is an open source remote configuration management solution developed by Michael De Haan in 2012. The name of the product is taken from science fiction literature: in the novels of the American writer Ursula Le Guin, an operable space communication device is called an ansible.

Ansible takes all the work of bringing remote servers to the required state. The administrator only needs to describe how to achieve this state using the so-called scripts (playbooks; this is analogous to the recipes in Chef). This technology allows you to very quickly reconfigure the system: just add a few new lines to the script.

Why Ansible?


The advantages of Ansible compared to other similar solutions (here, in the first place, such products as Puppet, Chef and Salt should be mentioned) are as follows:


Installation


Ansible installation requirements are minimal. On the machine that is being managed, Python 2.6 or higher must be installed. On managed nodes, only Python version 2.4 or higher should be installed, but, as a rule, it is included by default in most linux distribution systems. MS Windows is not supported.

You may also need the following Python modules installed via pip or package manager of your operating system:



In Ubuntu, installing Ansible itself and dependencies is done by adding a repository and installing the package:

sudo add-apt-repository -y ppa:rquillo/ansible sudo apt-get update sudo apt-get install ansible -y 

You can read about the installation procedure in other OS in the official documentation .

Server groups


The list of server groups to be managed can be obtained by Ansible in two main ways:


Hosts file


The default location of the file is / etc / ansible / hosts, but it can also be specified by the $ ANSIBLE_HOSTS environment parameter or the -i parameter when running ansible and ansible-playbook. The contents of this file may look, for example, as follows (in square brackets are the names of the groups of managed nodes, the servers in these groups are listed below):

 [dbservers] one.example.com two.example.com three.example.com [dnsservers] rs1.example.com ansible_ssh_port=5555 ansible_ssh_host=192.168.1.50 rs2.example.com ns[01:50].example.com 

In addition to the list of managed nodes, other information required for operation can be specified in the hosts file: port numbers for connecting via SSH, connection method, password for connecting via SSH, user name, merging groups, etc. In some cases - in particular, when working with large and complex configurations - various parameters can be put into separate files and directories (see the structure of directories below).

More details about the hosts file and the rules for writing it can be found in the official documentation .

Information about nodes (Facts)


Before making changes Ansible connects to managed nodes and collects information about them: about network interfaces and their status, about the installed operating system, etc. He can do this with his own module or with the help of the ohai and facter tools if they are installed (this feature is specifically provided for users who already have experience with remote configuration management systems: ohai and facter are fact libraries for Chef and Puppet ).
Variables

During deployment, as a rule, it is required not only to install any application, but also to configure it in accordance with certain parameters based on belonging to a server group or individually (for example, the BGP neighbor ip-address and its AS number or parameters for data). As already mentioned, to clutter up the hosts file will not be very nice, so the Ansible developers went the following way:


In addition to user variables, you can (and even need) use the facts collected ansible before executing scripts and individual tasks.

Ansible Modules


Ansible includes a huge number of modules for deploying, monitoring and managing various components, which can be divided into the following groups (the names of some products and services are given in brackets):


About that, with what Ansible β€œout of the box” can work, you can read in the official documentation . The list is really impressive.

Examples of simple tasks


With Ansible, you can simultaneously perform one task on a whole group of servers. Let's try, for example, to send a ping request to the servers of the selected group:

 $ ansible dnsservers -m ping dns1.example.com | success >> { "changed": false, "ping": "pong" } dns2.example.com | success >> { "changed": false, "ping": "pong" } 


The following example will collect information about hosts and output it to the console in JSON format:
 $ ansible dnsservers -m setup 

Conclusion
 dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.35" ], "ansible_all_ipv6_addresses": [ "fe80::ac2a:eaff:fe96:ea53" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "barrier": "off", "console": "ttyS0", "panic": "15", "ro": true, "root": "UUID=c5412437-f80e-4db4-81bc-75f751a60792", "xencons": "ttyS" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891466", "hour": "16", "iso8601": "2013-10-04T12:57:46Z", "iso8601_micro": "2013-10-04T12:57:46.130144Z", "minute": "57", "month": "10", "second": "46", "time": "16:57:46", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.35", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ae:aa:ea:96:ea:53", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "16482304", "sectorsize": 512, "size": "7.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "16777216", "sectorsize": "512", "size": "8.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Ubuntu", "ansible_distribution_release": "precise", "ansible_distribution_version": "12.04", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.35", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::ac2a:eaff:fe96:ea53", "prefix": "64", "scope": "link" } ], "macaddress": "ae:aa:ea:96:ea:53", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns1.example.com", "ansible_hostname": "dns1", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "precise", "description": "Ubuntu 12.04.3 LTS", "id": "Ubuntu", "major_release": "12", "release": "12.04" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 181, "ansible_memtotal_mb": 1061, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext4", "mount": "/", "options": "rw,errors=panic,barrier=0", "size_available": 6332063744, "size_total": 7798611968 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw", "size_available": 110679040, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3NzdC1kc3MAAACBAI09PTx0Jv2dAhmwGoPV45G6ZEiZ84TwjVm6HYbGOHUZe+CKnYwWThD8ZqXYzRyvVxCcVefiS6m0PKY6a5id2GySyQlTM952bDaifd09ot9pCWjwNp5q4/EQdIG3R9Kt96DfsraVrvmJWG1qQMaUlnsiZzxHWv4Fn+7BvP0Kn6AtAAAAFQDIeO7uTIVR/kzNTV9xHN/uW6KJ8wAAAIALATT5RMZUQhtwz42ek8254hrlEqSyMnWyq+vCDOp+2rE/dIkcBcd+xnfV2lTkeizAMTzYETOE8IES4rXWKFf2AlBTk9IQDnZI0ABlpUmXQVZvHxl8pKwLwzRPA7XeW4f4bXQXimUPHzCdnrwxLj7Qht4JaspL2znMCKOtpwWBrAAAAIB45bgP1JIlVpWaj1FJ/NKhDDv5D9yM7GXaljsUXL1T7KGtZ9yMA+sJa7Sw/HF88ag/gjxe6kUwmkrsvtrsza3WpfaMYupKFZtJwmQabxYPM1QWAtVONxeSo30IimFLQuaj6tgzfD1faJVyDdFydWNDUfZ3cn5iNsCz6khsc241zQ==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHA43NTYAAABBBH3b5e6ZUbR+gMLMiOwcQzwuEPE+KIXHmzywNcOIltWY4ZiGRXlQZMyEFMENiOSivFHByMBV0wJj8VMxJocHd7s=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDH5WKsJ0UJ8LDQMDBCcbkbdDVXcG2lhdBOmxCVm128ztp3PJrHQoNwy1njit/Sty34HYvwjVXvuaT8ksCSAGhi8VPvRo+oqGaSdt3T39Ew5DsKeJTOZDqL1Vz1jNbPvvVjsdB7v34zTgEdnjuTzlwPvtNtXyTJonXC0KDlLl5WAiYSb9XpLB0rjjKAGNautp0Mgx6olWadpMT/NWT0Ub5yHBJCWK+mYAwq0M2tK+QSrsukmG93flGLboVlWTfMIM+UUR2MH3OxI7ew6Oc5P2ligH3rcHhcAWwXLIAsMJ5vcmH0+pEvTGr9ucNMbXoZzAhX3hPN+KG8hbZ+AX3z0TXn", "ansible_swapfree_mb": 482, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.43" ], "ansible_all_ipv6_addresses": [ "fe80::cc2b:97ff:fe7b:d221" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "autorun": "fsck", "barrier": "off", "console": "xvc0", "ro": true, "root": "/dev/mapper/system-root" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891479", "hour": "16", "iso8601": "2013-10-04T12:57:59Z", "iso8601_micro": "2013-10-04T12:57:59.276859Z", "minute": "57", "month": "10", "second": "59", "time": "16:57:59", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.43", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ce:cb:97:7b:d2:21", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "12288000", "sectorsize": 512, "size": "5.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "12582912", "sectorsize": "512", "size": "6.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Debian", "ansible_distribution_release": "NA", "ansible_distribution_version": "7.0", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.43", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::cc2b:97ff:fe7b:d221", "prefix": "64", "scope": "link" } ], "macaddress": "ce:cb:97:7b:d2:21", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns2.example.com", "ansible_hostname": "dns2", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "wheezy", "description": "Debian GNU/Linux 7.0 (wheezy)", "id": "Debian", "major_release": "7", "release": "7.0" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 9, "ansible_memtotal_mb": 547, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext3", "mount": "/", "options": "rw,relatime,errors=panic,barrier=0,data=ordered", "size_available": 3733434368, "size_total": 5684838400 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw,relatime,user_xattr,acl,barrier=1", "size_available": 112991232, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3szaC1kc3MAAACBAJFX2aR1G5QM57/3vLSlLmPR46nXNPAx0jtf6fPWkit/64W5FFBH7BW9YtPHGrucAagz1drKd9SiE+U5GlVqg/4xXOLMHmWUHitivVV9obtkyF2BM/+1OKTwxGIBP6Vu3YP/Wbpbv5TDCxjClWpZs3kCWrqRsScTdZTkk66YDTmbAAAAFQCEEjs6jtnyfF45scSgIxy60we9bQAAAIAzlb3pno+ljpE7yEjh6oBvl1RgUeYzwJZxHkBRMfOt30DyaCuXhNVhykhGYFqybv66BSu3C2br+Zk3peQRf6rie7QWV/lAXyDfInbGxgklFX6yAcd+JYj4u2vJ9j2k3GinnN9TLL3kafn0oqduy8sujozTCFZcG7dJx+4NZY29ZgAAAIBB94cFFAxC56HApvuRAcU/Wr+YeyKtJ3IHDz0hLRO+ziyuMgr2ajG80LNBGzG3rV2AEXSlH6egXaLfzcn9iPlB7VFpB/Fg/GZGOSpIUCFSSpEke6AoO8Z19Y5uR2EfcegyHhWVXGkIsaIon5KnH1bC//XAn9ir7AmANUCeXSz1Fg==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM70PfnLbbXU+cJ27tWcKoom+P+TC08EncjB71bF4zp7Kw46YrWVjtPoFqAy3b1E2KkzUNcSrbJyEoCIgfzCC3Y=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCqltJwL3ThbfWbwBSuaZ2zZNRtcrjld0Z/ulAM6sygWTjHIeIuxT1lbJJFfKZneyo29nPho1q/HAlYGDRdcDZhKufNqDN/c9iFDbjnuPvCetUxxf+t9jKnUHnqDpO+fLYbosIEio9cmS/pOEwAU4+VBB8mdNAj9fjqrE08xcdEgt8QnAjIRlKDCdtTuYbisyt96GR10RrLPkr0epqGmHE6vzC1PyidqmQkGuCrcJHPJiS40J7S8QVP11TRS4Un+V6B7fTcfoZcPDrMsPj/NpOVh3egCJGg5VRJ2D3Fmoapg/R3ZPrMD/AW+PNQLa+1GSIVTc3cNu4ctXgnwQJwSjWL", "ansible_swapfree_mb": 412, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } / EQdIG3R9Kt96DfsraVrvmJWG1qQMaUlnsiZzxHWv4Fn + 7BvP0Kn6AtAAAAFQDIeO7uTIVR / kzNTV9xHN / uW6KJ8wAAAIALATT5RMZUQhtwz42ek8254hrlEqSyMnWyq + vCDOp + 2rE / dIkcBcd + xnfV2lTkeizAMTzYETOE8IES4rXWKFf2AlBTk9IQDnZI0ABlpUmXQVZvHxl8pKwLwzRPA7XeW4f4bXQXimUPHzCdnrwxLj7Qht4JaspL2znMCKOtpwWBrAAAAIB45bgP1JIlVpWaj1FJ / NKhDDv5D9yM7GXaljsUXL1T7KGtZ9yMA + sJa7Sw / HF88ag / gjxe6kUwmkrsvtrsza3WpfaMYupKFZtJwmQabxYPM1QWAtVONxeSo30IimFLQuaj6tgzfD1faJVyDdFydWNDUfZ3cn5iNsCz6khsc241zQ ==", dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.35" ], "ansible_all_ipv6_addresses": [ "fe80::ac2a:eaff:fe96:ea53" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "barrier": "off", "console": "ttyS0", "panic": "15", "ro": true, "root": "UUID=c5412437-f80e-4db4-81bc-75f751a60792", "xencons": "ttyS" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891466", "hour": "16", "iso8601": "2013-10-04T12:57:46Z", "iso8601_micro": "2013-10-04T12:57:46.130144Z", "minute": "57", "month": "10", "second": "46", "time": "16:57:46", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.35", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ae:aa:ea:96:ea:53", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "16482304", "sectorsize": 512, "size": "7.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "16777216", "sectorsize": "512", "size": "8.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Ubuntu", "ansible_distribution_release": "precise", "ansible_distribution_version": "12.04", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.35", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::ac2a:eaff:fe96:ea53", "prefix": "64", "scope": "link" } ], "macaddress": "ae:aa:ea:96:ea:53", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns1.example.com", "ansible_hostname": "dns1", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "precise", "description": "Ubuntu 12.04.3 LTS", "id": "Ubuntu", "major_release": "12", "release": "12.04" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 181, "ansible_memtotal_mb": 1061, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext4", "mount": "/", "options": "rw,errors=panic,barrier=0", "size_available": 6332063744, "size_total": 7798611968 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw", "size_available": 110679040, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3NzdC1kc3MAAACBAI09PTx0Jv2dAhmwGoPV45G6ZEiZ84TwjVm6HYbGOHUZe+CKnYwWThD8ZqXYzRyvVxCcVefiS6m0PKY6a5id2GySyQlTM952bDaifd09ot9pCWjwNp5q4/EQdIG3R9Kt96DfsraVrvmJWG1qQMaUlnsiZzxHWv4Fn+7BvP0Kn6AtAAAAFQDIeO7uTIVR/kzNTV9xHN/uW6KJ8wAAAIALATT5RMZUQhtwz42ek8254hrlEqSyMnWyq+vCDOp+2rE/dIkcBcd+xnfV2lTkeizAMTzYETOE8IES4rXWKFf2AlBTk9IQDnZI0ABlpUmXQVZvHxl8pKwLwzRPA7XeW4f4bXQXimUPHzCdnrwxLj7Qht4JaspL2znMCKOtpwWBrAAAAIB45bgP1JIlVpWaj1FJ/NKhDDv5D9yM7GXaljsUXL1T7KGtZ9yMA+sJa7Sw/HF88ag/gjxe6kUwmkrsvtrsza3WpfaMYupKFZtJwmQabxYPM1QWAtVONxeSo30IimFLQuaj6tgzfD1faJVyDdFydWNDUfZ3cn5iNsCz6khsc241zQ==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHA43NTYAAABBBH3b5e6ZUbR+gMLMiOwcQzwuEPE+KIXHmzywNcOIltWY4ZiGRXlQZMyEFMENiOSivFHByMBV0wJj8VMxJocHd7s=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDH5WKsJ0UJ8LDQMDBCcbkbdDVXcG2lhdBOmxCVm128ztp3PJrHQoNwy1njit/Sty34HYvwjVXvuaT8ksCSAGhi8VPvRo+oqGaSdt3T39Ew5DsKeJTOZDqL1Vz1jNbPvvVjsdB7v34zTgEdnjuTzlwPvtNtXyTJonXC0KDlLl5WAiYSb9XpLB0rjjKAGNautp0Mgx6olWadpMT/NWT0Ub5yHBJCWK+mYAwq0M2tK+QSrsukmG93flGLboVlWTfMIM+UUR2MH3OxI7ew6Oc5P2ligH3rcHhcAWwXLIAsMJ5vcmH0+pEvTGr9ucNMbXoZzAhX3hPN+KG8hbZ+AX3z0TXn", "ansible_swapfree_mb": 482, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.43" ], "ansible_all_ipv6_addresses": [ "fe80::cc2b:97ff:fe7b:d221" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "autorun": "fsck", "barrier": "off", "console": "xvc0", "ro": true, "root": "/dev/mapper/system-root" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891479", "hour": "16", "iso8601": "2013-10-04T12:57:59Z", "iso8601_micro": "2013-10-04T12:57:59.276859Z", "minute": "57", "month": "10", "second": "59", "time": "16:57:59", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.43", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ce:cb:97:7b:d2:21", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "12288000", "sectorsize": 512, "size": "5.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "12582912", "sectorsize": "512", "size": "6.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Debian", "ansible_distribution_release": "NA", "ansible_distribution_version": "7.0", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.43", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::cc2b:97ff:fe7b:d221", "prefix": "64", "scope": "link" } ], "macaddress": "ce:cb:97:7b:d2:21", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns2.example.com", "ansible_hostname": "dns2", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "wheezy", "description": "Debian GNU/Linux 7.0 (wheezy)", "id": "Debian", "major_release": "7", "release": "7.0" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 9, "ansible_memtotal_mb": 547, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext3", "mount": "/", "options": "rw,relatime,errors=panic,barrier=0,data=ordered", "size_available": 3733434368, "size_total": 5684838400 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw,relatime,user_xattr,acl,barrier=1", "size_available": 112991232, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3szaC1kc3MAAACBAJFX2aR1G5QM57/3vLSlLmPR46nXNPAx0jtf6fPWkit/64W5FFBH7BW9YtPHGrucAagz1drKd9SiE+U5GlVqg/4xXOLMHmWUHitivVV9obtkyF2BM/+1OKTwxGIBP6Vu3YP/Wbpbv5TDCxjClWpZs3kCWrqRsScTdZTkk66YDTmbAAAAFQCEEjs6jtnyfF45scSgIxy60we9bQAAAIAzlb3pno+ljpE7yEjh6oBvl1RgUeYzwJZxHkBRMfOt30DyaCuXhNVhykhGYFqybv66BSu3C2br+Zk3peQRf6rie7QWV/lAXyDfInbGxgklFX6yAcd+JYj4u2vJ9j2k3GinnN9TLL3kafn0oqduy8sujozTCFZcG7dJx+4NZY29ZgAAAIBB94cFFAxC56HApvuRAcU/Wr+YeyKtJ3IHDz0hLRO+ziyuMgr2ajG80LNBGzG3rV2AEXSlH6egXaLfzcn9iPlB7VFpB/Fg/GZGOSpIUCFSSpEke6AoO8Z19Y5uR2EfcegyHhWVXGkIsaIon5KnH1bC//XAn9ir7AmANUCeXSz1Fg==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM70PfnLbbXU+cJ27tWcKoom+P+TC08EncjB71bF4zp7Kw46YrWVjtPoFqAy3b1E2KkzUNcSrbJyEoCIgfzCC3Y=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCqltJwL3ThbfWbwBSuaZ2zZNRtcrjld0Z/ulAM6sygWTjHIeIuxT1lbJJFfKZneyo29nPho1q/HAlYGDRdcDZhKufNqDN/c9iFDbjnuPvCetUxxf+t9jKnUHnqDpO+fLYbosIEio9cmS/pOEwAU4+VBB8mdNAj9fjqrE08xcdEgt8QnAjIRlKDCdtTuYbisyt96GR10RrLPkr0epqGmHE6vzC1PyidqmQkGuCrcJHPJiS40J7S8QVP11TRS4Un+V6B7fTcfoZcPDrMsPj/NpOVh3egCJGg5VRJ2D3Fmoapg/R3ZPrMD/AW+PNQLa+1GSIVTc3cNu4ctXgnwQJwSjWL", "ansible_swapfree_mb": 412, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } + oqGaSdt3T39Ew5DsKeJTOZDqL1Vz1jNbPvvVjsdB7v34zTgEdnjuTzlwPvtNtXyTJonXC0KDlLl5WAiYSb9XpLB0rjjKAGNautp0Mgx6olWadpMT / NWT0Ub5yHBJCWK + mYAwq0M2tK + QSrsukmG93flGLboVlWTfMIM + UUR2MH3OxI7ew6Oc5P2ligH3rcHhcAWwXLIAsMJ5vcmH0 + pEvTGr9ucNMbXoZzAhX3hPN + KG8hbZ + AX3z0TXn", dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.35" ], "ansible_all_ipv6_addresses": [ "fe80::ac2a:eaff:fe96:ea53" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "barrier": "off", "console": "ttyS0", "panic": "15", "ro": true, "root": "UUID=c5412437-f80e-4db4-81bc-75f751a60792", "xencons": "ttyS" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891466", "hour": "16", "iso8601": "2013-10-04T12:57:46Z", "iso8601_micro": "2013-10-04T12:57:46.130144Z", "minute": "57", "month": "10", "second": "46", "time": "16:57:46", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.35", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ae:aa:ea:96:ea:53", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "16482304", "sectorsize": 512, "size": "7.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "16777216", "sectorsize": "512", "size": "8.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Ubuntu", "ansible_distribution_release": "precise", "ansible_distribution_version": "12.04", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.35", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::ac2a:eaff:fe96:ea53", "prefix": "64", "scope": "link" } ], "macaddress": "ae:aa:ea:96:ea:53", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns1.example.com", "ansible_hostname": "dns1", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "precise", "description": "Ubuntu 12.04.3 LTS", "id": "Ubuntu", "major_release": "12", "release": "12.04" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 181, "ansible_memtotal_mb": 1061, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext4", "mount": "/", "options": "rw,errors=panic,barrier=0", "size_available": 6332063744, "size_total": 7798611968 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw", "size_available": 110679040, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3NzdC1kc3MAAACBAI09PTx0Jv2dAhmwGoPV45G6ZEiZ84TwjVm6HYbGOHUZe+CKnYwWThD8ZqXYzRyvVxCcVefiS6m0PKY6a5id2GySyQlTM952bDaifd09ot9pCWjwNp5q4/EQdIG3R9Kt96DfsraVrvmJWG1qQMaUlnsiZzxHWv4Fn+7BvP0Kn6AtAAAAFQDIeO7uTIVR/kzNTV9xHN/uW6KJ8wAAAIALATT5RMZUQhtwz42ek8254hrlEqSyMnWyq+vCDOp+2rE/dIkcBcd+xnfV2lTkeizAMTzYETOE8IES4rXWKFf2AlBTk9IQDnZI0ABlpUmXQVZvHxl8pKwLwzRPA7XeW4f4bXQXimUPHzCdnrwxLj7Qht4JaspL2znMCKOtpwWBrAAAAIB45bgP1JIlVpWaj1FJ/NKhDDv5D9yM7GXaljsUXL1T7KGtZ9yMA+sJa7Sw/HF88ag/gjxe6kUwmkrsvtrsza3WpfaMYupKFZtJwmQabxYPM1QWAtVONxeSo30IimFLQuaj6tgzfD1faJVyDdFydWNDUfZ3cn5iNsCz6khsc241zQ==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHA43NTYAAABBBH3b5e6ZUbR+gMLMiOwcQzwuEPE+KIXHmzywNcOIltWY4ZiGRXlQZMyEFMENiOSivFHByMBV0wJj8VMxJocHd7s=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDH5WKsJ0UJ8LDQMDBCcbkbdDVXcG2lhdBOmxCVm128ztp3PJrHQoNwy1njit/Sty34HYvwjVXvuaT8ksCSAGhi8VPvRo+oqGaSdt3T39Ew5DsKeJTOZDqL1Vz1jNbPvvVjsdB7v34zTgEdnjuTzlwPvtNtXyTJonXC0KDlLl5WAiYSb9XpLB0rjjKAGNautp0Mgx6olWadpMT/NWT0Ub5yHBJCWK+mYAwq0M2tK+QSrsukmG93flGLboVlWTfMIM+UUR2MH3OxI7ew6Oc5P2ligH3rcHhcAWwXLIAsMJ5vcmH0+pEvTGr9ucNMbXoZzAhX3hPN+KG8hbZ+AX3z0TXn", "ansible_swapfree_mb": 482, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.43" ], "ansible_all_ipv6_addresses": [ "fe80::cc2b:97ff:fe7b:d221" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "autorun": "fsck", "barrier": "off", "console": "xvc0", "ro": true, "root": "/dev/mapper/system-root" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891479", "hour": "16", "iso8601": "2013-10-04T12:57:59Z", "iso8601_micro": "2013-10-04T12:57:59.276859Z", "minute": "57", "month": "10", "second": "59", "time": "16:57:59", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.43", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ce:cb:97:7b:d2:21", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "12288000", "sectorsize": 512, "size": "5.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "12582912", "sectorsize": "512", "size": "6.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Debian", "ansible_distribution_release": "NA", "ansible_distribution_version": "7.0", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.43", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::cc2b:97ff:fe7b:d221", "prefix": "64", "scope": "link" } ], "macaddress": "ce:cb:97:7b:d2:21", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns2.example.com", "ansible_hostname": "dns2", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "wheezy", "description": "Debian GNU/Linux 7.0 (wheezy)", "id": "Debian", "major_release": "7", "release": "7.0" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 9, "ansible_memtotal_mb": 547, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext3", "mount": "/", "options": "rw,relatime,errors=panic,barrier=0,data=ordered", "size_available": 3733434368, "size_total": 5684838400 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw,relatime,user_xattr,acl,barrier=1", "size_available": 112991232, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3szaC1kc3MAAACBAJFX2aR1G5QM57/3vLSlLmPR46nXNPAx0jtf6fPWkit/64W5FFBH7BW9YtPHGrucAagz1drKd9SiE+U5GlVqg/4xXOLMHmWUHitivVV9obtkyF2BM/+1OKTwxGIBP6Vu3YP/Wbpbv5TDCxjClWpZs3kCWrqRsScTdZTkk66YDTmbAAAAFQCEEjs6jtnyfF45scSgIxy60we9bQAAAIAzlb3pno+ljpE7yEjh6oBvl1RgUeYzwJZxHkBRMfOt30DyaCuXhNVhykhGYFqybv66BSu3C2br+Zk3peQRf6rie7QWV/lAXyDfInbGxgklFX6yAcd+JYj4u2vJ9j2k3GinnN9TLL3kafn0oqduy8sujozTCFZcG7dJx+4NZY29ZgAAAIBB94cFFAxC56HApvuRAcU/Wr+YeyKtJ3IHDz0hLRO+ziyuMgr2ajG80LNBGzG3rV2AEXSlH6egXaLfzcn9iPlB7VFpB/Fg/GZGOSpIUCFSSpEke6AoO8Z19Y5uR2EfcegyHhWVXGkIsaIon5KnH1bC//XAn9ir7AmANUCeXSz1Fg==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM70PfnLbbXU+cJ27tWcKoom+P+TC08EncjB71bF4zp7Kw46YrWVjtPoFqAy3b1E2KkzUNcSrbJyEoCIgfzCC3Y=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCqltJwL3ThbfWbwBSuaZ2zZNRtcrjld0Z/ulAM6sygWTjHIeIuxT1lbJJFfKZneyo29nPho1q/HAlYGDRdcDZhKufNqDN/c9iFDbjnuPvCetUxxf+t9jKnUHnqDpO+fLYbosIEio9cmS/pOEwAU4+VBB8mdNAj9fjqrE08xcdEgt8QnAjIRlKDCdtTuYbisyt96GR10RrLPkr0epqGmHE6vzC1PyidqmQkGuCrcJHPJiS40J7S8QVP11TRS4Un+V6B7fTcfoZcPDrMsPj/NpOVh3egCJGg5VRJ2D3Fmoapg/R3ZPrMD/AW+PNQLa+1GSIVTc3cNu4ctXgnwQJwSjWL", "ansible_swapfree_mb": 412, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } / 64W5FFBH7BW9YtPHGrucAagz1drKd9SiE + U5GlVqg / 4xXOLMHmWUHitivVV9obtkyF2BM / + 1OKTwxGIBP6Vu3YP / Wbpbv5TDCxjClWpZs3kCWrqRsScTdZTkk66YDTmbAAAAFQCEEjs6jtnyfF45scSgIxy60we9bQAAAIAzlb3pno + ljpE7yEjh6oBvl1RgUeYzwJZxHkBRMfOt30DyaCuXhNVhykhGYFqybv66BSu3C2br + Zk3peQRf6rie7QWV / lAXyDfInbGxgklFX6yAcd + JYj4u2vJ9j2k3GinnN9TLL3kafn0oqduy8sujozTCFZcG7dJx + 4NZY29ZgAAAIBB94cFFAxC56HApvuRAcU / Wr + YeyKtJ3IHDz0hLRO + ziyuMgr2ajG80LNBGzG3rV2AEXSlH6egXaLfzcn9iPlB7VFpB / Fg / GZGOSpIUCFSSpEke6AoO8Z19Y5uR2EfcegyHhWVXGkIsaIon5KnH1bC // XAn9ir7AmANUCeXSz1Fg ==", dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.35" ], "ansible_all_ipv6_addresses": [ "fe80::ac2a:eaff:fe96:ea53" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "barrier": "off", "console": "ttyS0", "panic": "15", "ro": true, "root": "UUID=c5412437-f80e-4db4-81bc-75f751a60792", "xencons": "ttyS" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891466", "hour": "16", "iso8601": "2013-10-04T12:57:46Z", "iso8601_micro": "2013-10-04T12:57:46.130144Z", "minute": "57", "month": "10", "second": "46", "time": "16:57:46", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.35", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ae:aa:ea:96:ea:53", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "16482304", "sectorsize": 512, "size": "7.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "16777216", "sectorsize": "512", "size": "8.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Ubuntu", "ansible_distribution_release": "precise", "ansible_distribution_version": "12.04", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.35", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::ac2a:eaff:fe96:ea53", "prefix": "64", "scope": "link" } ], "macaddress": "ae:aa:ea:96:ea:53", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns1.example.com", "ansible_hostname": "dns1", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "precise", "description": "Ubuntu 12.04.3 LTS", "id": "Ubuntu", "major_release": "12", "release": "12.04" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 181, "ansible_memtotal_mb": 1061, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext4", "mount": "/", "options": "rw,errors=panic,barrier=0", "size_available": 6332063744, "size_total": 7798611968 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw", "size_available": 110679040, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3NzdC1kc3MAAACBAI09PTx0Jv2dAhmwGoPV45G6ZEiZ84TwjVm6HYbGOHUZe+CKnYwWThD8ZqXYzRyvVxCcVefiS6m0PKY6a5id2GySyQlTM952bDaifd09ot9pCWjwNp5q4/EQdIG3R9Kt96DfsraVrvmJWG1qQMaUlnsiZzxHWv4Fn+7BvP0Kn6AtAAAAFQDIeO7uTIVR/kzNTV9xHN/uW6KJ8wAAAIALATT5RMZUQhtwz42ek8254hrlEqSyMnWyq+vCDOp+2rE/dIkcBcd+xnfV2lTkeizAMTzYETOE8IES4rXWKFf2AlBTk9IQDnZI0ABlpUmXQVZvHxl8pKwLwzRPA7XeW4f4bXQXimUPHzCdnrwxLj7Qht4JaspL2znMCKOtpwWBrAAAAIB45bgP1JIlVpWaj1FJ/NKhDDv5D9yM7GXaljsUXL1T7KGtZ9yMA+sJa7Sw/HF88ag/gjxe6kUwmkrsvtrsza3WpfaMYupKFZtJwmQabxYPM1QWAtVONxeSo30IimFLQuaj6tgzfD1faJVyDdFydWNDUfZ3cn5iNsCz6khsc241zQ==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHA43NTYAAABBBH3b5e6ZUbR+gMLMiOwcQzwuEPE+KIXHmzywNcOIltWY4ZiGRXlQZMyEFMENiOSivFHByMBV0wJj8VMxJocHd7s=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDH5WKsJ0UJ8LDQMDBCcbkbdDVXcG2lhdBOmxCVm128ztp3PJrHQoNwy1njit/Sty34HYvwjVXvuaT8ksCSAGhi8VPvRo+oqGaSdt3T39Ew5DsKeJTOZDqL1Vz1jNbPvvVjsdB7v34zTgEdnjuTzlwPvtNtXyTJonXC0KDlLl5WAiYSb9XpLB0rjjKAGNautp0Mgx6olWadpMT/NWT0Ub5yHBJCWK+mYAwq0M2tK+QSrsukmG93flGLboVlWTfMIM+UUR2MH3OxI7ew6Oc5P2ligH3rcHhcAWwXLIAsMJ5vcmH0+pEvTGr9ucNMbXoZzAhX3hPN+KG8hbZ+AX3z0TXn", "ansible_swapfree_mb": 482, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.43" ], "ansible_all_ipv6_addresses": [ "fe80::cc2b:97ff:fe7b:d221" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "autorun": "fsck", "barrier": "off", "console": "xvc0", "ro": true, "root": "/dev/mapper/system-root" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891479", "hour": "16", "iso8601": "2013-10-04T12:57:59Z", "iso8601_micro": "2013-10-04T12:57:59.276859Z", "minute": "57", "month": "10", "second": "59", "time": "16:57:59", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.43", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ce:cb:97:7b:d2:21", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "12288000", "sectorsize": 512, "size": "5.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "12582912", "sectorsize": "512", "size": "6.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Debian", "ansible_distribution_release": "NA", "ansible_distribution_version": "7.0", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.43", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::cc2b:97ff:fe7b:d221", "prefix": "64", "scope": "link" } ], "macaddress": "ce:cb:97:7b:d2:21", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns2.example.com", "ansible_hostname": "dns2", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "wheezy", "description": "Debian GNU/Linux 7.0 (wheezy)", "id": "Debian", "major_release": "7", "release": "7.0" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 9, "ansible_memtotal_mb": 547, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext3", "mount": "/", "options": "rw,relatime,errors=panic,barrier=0,data=ordered", "size_available": 3733434368, "size_total": 5684838400 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw,relatime,user_xattr,acl,barrier=1", "size_available": 112991232, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3szaC1kc3MAAACBAJFX2aR1G5QM57/3vLSlLmPR46nXNPAx0jtf6fPWkit/64W5FFBH7BW9YtPHGrucAagz1drKd9SiE+U5GlVqg/4xXOLMHmWUHitivVV9obtkyF2BM/+1OKTwxGIBP6Vu3YP/Wbpbv5TDCxjClWpZs3kCWrqRsScTdZTkk66YDTmbAAAAFQCEEjs6jtnyfF45scSgIxy60we9bQAAAIAzlb3pno+ljpE7yEjh6oBvl1RgUeYzwJZxHkBRMfOt30DyaCuXhNVhykhGYFqybv66BSu3C2br+Zk3peQRf6rie7QWV/lAXyDfInbGxgklFX6yAcd+JYj4u2vJ9j2k3GinnN9TLL3kafn0oqduy8sujozTCFZcG7dJx+4NZY29ZgAAAIBB94cFFAxC56HApvuRAcU/Wr+YeyKtJ3IHDz0hLRO+ziyuMgr2ajG80LNBGzG3rV2AEXSlH6egXaLfzcn9iPlB7VFpB/Fg/GZGOSpIUCFSSpEke6AoO8Z19Y5uR2EfcegyHhWVXGkIsaIon5KnH1bC//XAn9ir7AmANUCeXSz1Fg==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM70PfnLbbXU+cJ27tWcKoom+P+TC08EncjB71bF4zp7Kw46YrWVjtPoFqAy3b1E2KkzUNcSrbJyEoCIgfzCC3Y=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCqltJwL3ThbfWbwBSuaZ2zZNRtcrjld0Z/ulAM6sygWTjHIeIuxT1lbJJFfKZneyo29nPho1q/HAlYGDRdcDZhKufNqDN/c9iFDbjnuPvCetUxxf+t9jKnUHnqDpO+fLYbosIEio9cmS/pOEwAU4+VBB8mdNAj9fjqrE08xcdEgt8QnAjIRlKDCdtTuYbisyt96GR10RrLPkr0epqGmHE6vzC1PyidqmQkGuCrcJHPJiS40J7S8QVP11TRS4Un+V6B7fTcfoZcPDrMsPj/NpOVh3egCJGg5VRJ2D3Fmoapg/R3ZPrMD/AW+PNQLa+1GSIVTc3cNu4ctXgnwQJwSjWL", "ansible_swapfree_mb": 412, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } / HAlYGDRdcDZhKufNqDN / c9iFDbjnuPvCetUxxf + t9jKnUHnqDpO + fLYbosIEio9cmS / pOEwAU4 + VBB8mdNAj9fjqrE08xcdEgt8QnAjIRlKDCdtTuYbisyt96GR10RrLPkr0epqGmHE6vzC1PyidqmQkGuCrcJHPJiS40J7S8QVP11TRS4Un + V6B7fTcfoZcPDrMsPj / NpOVh3egCJGg5VRJ2D3Fmoapg / R3ZPrMD / AW + PNQLa + 1GSIVTc3cNu4ctXgnwQJwSjWL", dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.35" ], "ansible_all_ipv6_addresses": [ "fe80::ac2a:eaff:fe96:ea53" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "barrier": "off", "console": "ttyS0", "panic": "15", "ro": true, "root": "UUID=c5412437-f80e-4db4-81bc-75f751a60792", "xencons": "ttyS" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891466", "hour": "16", "iso8601": "2013-10-04T12:57:46Z", "iso8601_micro": "2013-10-04T12:57:46.130144Z", "minute": "57", "month": "10", "second": "46", "time": "16:57:46", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.35", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ae:aa:ea:96:ea:53", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "16482304", "sectorsize": 512, "size": "7.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "16777216", "sectorsize": "512", "size": "8.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Ubuntu", "ansible_distribution_release": "precise", "ansible_distribution_version": "12.04", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.35", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::ac2a:eaff:fe96:ea53", "prefix": "64", "scope": "link" } ], "macaddress": "ae:aa:ea:96:ea:53", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns1.example.com", "ansible_hostname": "dns1", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "precise", "description": "Ubuntu 12.04.3 LTS", "id": "Ubuntu", "major_release": "12", "release": "12.04" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 181, "ansible_memtotal_mb": 1061, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext4", "mount": "/", "options": "rw,errors=panic,barrier=0", "size_available": 6332063744, "size_total": 7798611968 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw", "size_available": 110679040, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3NzdC1kc3MAAACBAI09PTx0Jv2dAhmwGoPV45G6ZEiZ84TwjVm6HYbGOHUZe+CKnYwWThD8ZqXYzRyvVxCcVefiS6m0PKY6a5id2GySyQlTM952bDaifd09ot9pCWjwNp5q4/EQdIG3R9Kt96DfsraVrvmJWG1qQMaUlnsiZzxHWv4Fn+7BvP0Kn6AtAAAAFQDIeO7uTIVR/kzNTV9xHN/uW6KJ8wAAAIALATT5RMZUQhtwz42ek8254hrlEqSyMnWyq+vCDOp+2rE/dIkcBcd+xnfV2lTkeizAMTzYETOE8IES4rXWKFf2AlBTk9IQDnZI0ABlpUmXQVZvHxl8pKwLwzRPA7XeW4f4bXQXimUPHzCdnrwxLj7Qht4JaspL2znMCKOtpwWBrAAAAIB45bgP1JIlVpWaj1FJ/NKhDDv5D9yM7GXaljsUXL1T7KGtZ9yMA+sJa7Sw/HF88ag/gjxe6kUwmkrsvtrsza3WpfaMYupKFZtJwmQabxYPM1QWAtVONxeSo30IimFLQuaj6tgzfD1faJVyDdFydWNDUfZ3cn5iNsCz6khsc241zQ==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHA43NTYAAABBBH3b5e6ZUbR+gMLMiOwcQzwuEPE+KIXHmzywNcOIltWY4ZiGRXlQZMyEFMENiOSivFHByMBV0wJj8VMxJocHd7s=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDH5WKsJ0UJ8LDQMDBCcbkbdDVXcG2lhdBOmxCVm128ztp3PJrHQoNwy1njit/Sty34HYvwjVXvuaT8ksCSAGhi8VPvRo+oqGaSdt3T39Ew5DsKeJTOZDqL1Vz1jNbPvvVjsdB7v34zTgEdnjuTzlwPvtNtXyTJonXC0KDlLl5WAiYSb9XpLB0rjjKAGNautp0Mgx6olWadpMT/NWT0Ub5yHBJCWK+mYAwq0M2tK+QSrsukmG93flGLboVlWTfMIM+UUR2MH3OxI7ew6Oc5P2ligH3rcHhcAWwXLIAsMJ5vcmH0+pEvTGr9ucNMbXoZzAhX3hPN+KG8hbZ+AX3z0TXn", "ansible_swapfree_mb": 482, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } dns1.example.com | success >> { "ansible_facts": { "ansible_all_ipv4_addresses": [ "192.168.1.43" ], "ansible_all_ipv6_addresses": [ "fe80::cc2b:97ff:fe7b:d221" ], "ansible_architecture": "x86_64", "ansible_bios_date": "", "ansible_bios_version": "", "ansible_cmdline": { "autorun": "fsck", "barrier": "off", "console": "xvc0", "ro": true, "root": "/dev/mapper/system-root" }, "ansible_date_time": { "date": "2013-10-04", "day": "04", "epoch": "1380891479", "hour": "16", "iso8601": "2013-10-04T12:57:59Z", "iso8601_micro": "2013-10-04T12:57:59.276859Z", "minute": "57", "month": "10", "second": "59", "time": "16:57:59", "tz": "MSK", "year": "2013" }, "ansible_default_ipv4": { "address": "192.168.1.43", "alias": "eth0", "gateway": "192.168.1.1", "interface": "eth0", "macaddress": "ce:cb:97:7b:d2:21", "mtu": 1500, "netmask": "255.255.255.0", "network": "192.168.1.0", "type": "ether" }, "ansible_default_ipv6": {}, "ansible_devices": { "xvda": { "holders": [], "host": "", "model": null, "partitions": { "xvda1": { "sectors": "290816", "sectorsize": 512, "size": "142.00 MB", "start": "2048" }, "xvda2": { "sectors": "12288000", "sectorsize": 512, "size": "5.86 GB", "start": "292864" } }, "removable": "0", "rotational": "0", "scheduler_mode": "cfq", "sectors": "12582912", "sectorsize": "512", "size": "6.00 GB", "support_discard": "0", "vendor": null } }, "ansible_distribution": "Debian", "ansible_distribution_release": "NA", "ansible_distribution_version": "7.0", "ansible_domain": "", "ansible_eth0": { "active": true, "device": "eth0", "ipv4": { "address": "192.168.1.43", "netmask": "255.255.255.0", "network": "192.168.1.0" }, "ipv6": [ { "address": "fe80::cc2b:97ff:fe7b:d221", "prefix": "64", "scope": "link" } ], "macaddress": "ce:cb:97:7b:d2:21", "module": "xennet", "mtu": 1500, "type": "ether" }, "ansible_form_factor": "", "ansible_fqdn": "dns2.example.com", "ansible_hostname": "dns2", "ansible_interfaces": [ "lo", "eth0" ], "ansible_kernel": "3.1.0-1.2-xen", "ansible_lo": { "active": true, "device": "lo", "ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0", "network": "127.0.0.0" }, "ipv6": [ { "address": "::1", "prefix": "128", "scope": "host" } ], "mtu": 16436, "type": "loopback" }, "ansible_lsb": { "codename": "wheezy", "description": "Debian GNU/Linux 7.0 (wheezy)", "id": "Debian", "major_release": "7", "release": "7.0" }, "ansible_machine": "x86_64", "ansible_memfree_mb": 9, "ansible_memtotal_mb": 547, "ansible_mounts": [ { "device": "/dev/mapper/system-root", "fstype": "ext3", "mount": "/", "options": "rw,relatime,errors=panic,barrier=0,data=ordered", "size_available": 3733434368, "size_total": 5684838400 }, { "device": "/dev/xvda1", "fstype": "ext2", "mount": "/boot", "options": "rw,relatime,user_xattr,acl,barrier=1", "size_available": 112991232, "size_total": 139539456 } ], "ansible_os_family": "Debian", "ansible_pkg_mgr": "apt", "ansible_processor": [ "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz", "Intel(R) Xeon(R) CPU E5620 @ 2.40GHz" ], "ansible_processor_cores": 1, "ansible_processor_count": 8, "ansible_processor_threads_per_core": 1, "ansible_processor_vcpus": 8, "ansible_product_name": "", "ansible_product_serial": "", "ansible_product_uuid": "", "ansible_product_version": "", "ansible_python_version": "2.7.3", "ansible_selinux": false, "ansible_ssh_host_key_dsa_public": "AAAAB3szaC1kc3MAAACBAJFX2aR1G5QM57/3vLSlLmPR46nXNPAx0jtf6fPWkit/64W5FFBH7BW9YtPHGrucAagz1drKd9SiE+U5GlVqg/4xXOLMHmWUHitivVV9obtkyF2BM/+1OKTwxGIBP6Vu3YP/Wbpbv5TDCxjClWpZs3kCWrqRsScTdZTkk66YDTmbAAAAFQCEEjs6jtnyfF45scSgIxy60we9bQAAAIAzlb3pno+ljpE7yEjh6oBvl1RgUeYzwJZxHkBRMfOt30DyaCuXhNVhykhGYFqybv66BSu3C2br+Zk3peQRf6rie7QWV/lAXyDfInbGxgklFX6yAcd+JYj4u2vJ9j2k3GinnN9TLL3kafn0oqduy8sujozTCFZcG7dJx+4NZY29ZgAAAIBB94cFFAxC56HApvuRAcU/Wr+YeyKtJ3IHDz0hLRO+ziyuMgr2ajG80LNBGzG3rV2AEXSlH6egXaLfzcn9iPlB7VFpB/Fg/GZGOSpIUCFSSpEke6AoO8Z19Y5uR2EfcegyHhWVXGkIsaIon5KnH1bC//XAn9ir7AmANUCeXSz1Fg==", "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM70PfnLbbXU+cJ27tWcKoom+P+TC08EncjB71bF4zp7Kw46YrWVjtPoFqAy3b1E2KkzUNcSrbJyEoCIgfzCC3Y=", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCqltJwL3ThbfWbwBSuaZ2zZNRtcrjld0Z/ulAM6sygWTjHIeIuxT1lbJJFfKZneyo29nPho1q/HAlYGDRdcDZhKufNqDN/c9iFDbjnuPvCetUxxf+t9jKnUHnqDpO+fLYbosIEio9cmS/pOEwAU4+VBB8mdNAj9fjqrE08xcdEgt8QnAjIRlKDCdtTuYbisyt96GR10RrLPkr0epqGmHE6vzC1PyidqmQkGuCrcJHPJiS40J7S8QVP11TRS4Un+V6B7fTcfoZcPDrMsPj/NpOVh3egCJGg5VRJ2D3Fmoapg/R3ZPrMD/AW+PNQLa+1GSIVTc3cNu4ctXgnwQJwSjWL", "ansible_swapfree_mb": 412, "ansible_swaptotal_mb": 487, "ansible_system": "Linux", "ansible_system_vendor": "", "ansible_user_id": "root", "ansible_userspace_architecture": "x86_64", "ansible_userspace_bits": "64", "ansible_virtualization_role": "guest", "ansible_virtualization_type": "xen" }, "changed": false } 



And this is how you can create a logical volume (or, depending on the current state, change its size) with the name examplevolume in the examplegroup group:
 $ ansible dnsservers -m lvol -a "vg=examplegroup lv=examplevolume size=1024 state=present" dns1.example.com | success >> { "changed": true, "msg": "" } dns2.example.com | success >> { "changed": false, "msg": "" } 

Ansible allows you to not only perform single tasks, but also to write scripts that must be executed on managed nodes. Consider the structure and rules for writing such scripts in more detail.

Scripts (playbooks)


All scripts in Ansible are written in YAML. This is a human-readable serialized data format, much simpler than XML or JSON.

To execute the script, use the ansible-playbook command with the following syntax:

 ansible-playbook <__.yml> ... [ ] 

At the beginning of the script, there must be a sequence of characters β€œβ€“β€“β€“β€ (this is how the beginning of the document is indicated in YAML). Each new section of the list has a hyphen (-):

 --- - hosts: webservers 

The main parameters / groups of a simple script are:


Also in the script, the following parameters or groups of parameters may be indicated before the direct description of the tasks:


Consider some sections in more detail.

The hosts section indicates the group of managed nodes to which the changes described in the script will be applied.

So, the format string:

 hosts: webservers 

means that changes will be applied to nodes from the webservers group.

Scripts can be executed not only on behalf of the user under whose name the connection is established, but also of any other. In the following example, the authorization on the host will be done with the name yourname, but the tasks will be performed on behalf of the root user (unless, of course, this user is allowed to use sudo):

 --- - hosts: webservers user: yourname sudo: yes 

If you add the β€œuser: postgres” parameter, then all actions will be performed with the privileges of the postgres user.

The vars section contains variables that will be used in the script, and their values:

 - hosts: webservers vars: http_port: 80 max_clients: 200 

A list of changes / states that must be made on the managed node is provided in the tasks section. Each task (task) is given a name (name), it can be omitted. Next, the Ansible module is specified, which will be used during its execution:

 - hosts: webservers user: yourname tasks: - service: name=nginx state=started 

For each task, you can specify the user on whose behalf it will be executed:

 --- - hosts: webservers user: yourname tasks: - service: name=nginx state=started sudo: yes 


Templates


Ansbile uses the Jinja2 template engine. Here is an example of a simple template (part of the powerdns config ):

 #       gpgsql-password={{ lookup('password', 'credentials/' + inventory_hostname + '/postgresql/powerdns', length=15) }} # IPv4-,   β€œβ€ powerdns local-address={{ ansible_default_ipv4.address }} # IPv6-,   β€œβ€ powerdns local-ipv6={{ ansible_default_ipv6.address }} # nsid dns- (EDNS option 3, rfc5001) server-id={{ ansible_hostname }} 

In the given example, we substitute the following values ​​into the template:

The processing of templates and, in this case, the generation of the configuration file is performed by the template module; he can also set the necessary access rights and change the owner / group:

 - name: generate powerdns config template: src=pdns.conf.j2 dest=/etc/powerdns/pdns.conf owner=powerdns group=powerdns mode=600 

Note that the template file and the file with the database user password are located on the management machine, and the result will be a file on the remote node.

Event Handlers


Ansible not only performs tasks in the specified order, but also checks their status for changes. If, when executing a script, it was necessary, for example, to add a line to the configuration file, and as a result of the execution it changed (there was really no necessary line), then Ansible can perform a special task described as an event handler. If at execution the line was already in the configuration file, the handler will not be executed. Event handlers are described at the end of the script; in the task description, they are specified via the notify parameter. Let's give an example:

 --- - hosts: webservers vars: max_clients: 200 tasks: #       #  ,     β€œrestart apache” #    - name: write the apache config file template: src=/srv/httpd.j2 dest=/etc/httpd.conf notify: - restart apache - name: ensure apache is running service: name=httpd state=started #    handlers: - name: restart apache #   service   - service: name=httpd state=restarted 


Performance monitoring


Suppose that when executing a script, we need to check certain variables or states and, depending on them, to perform or not perform any tasks. For this, you can use the β€œwhen” statement:

 tasks: #        #   last_result - template: src=/templates/foo.j2 dest=/etc/foo.conf register: last_result #   last_result.changed     #  true -   ,  -   - command: echo 'the file has changed' when: last_result.changed 


Delegating a task to another host


Sometimes you need to perform a task on a specific node, but in the context of another node. For example, during a site update, it may be necessary to disable monitoring on a separate server for it. For this, the delegate_to control directive is used. Let's give an example:

 - name: disable nagios alerts for this host webserver service nagios: action=disable_alerts host={{inventory_hostname}} services=dnsserver delegate_to: mon_host.example.com 

The result of this task will be disabling messages for the dnsserver service in Nagios.

Roles


A role is a typical set of variables and tasks assigned to one or more servers. If you need to apply a typical set of operations to a server or group of servers, you just need to assign it a role. Previously in the project project directory should be created the appropriate structure. In scenarios, roles are assigned as follows:

 --- - name: check and apply basic configuration to all hosts hosts: all roles: - common - name: check and apply configuration to group1 hosts: group1 roles: - pgsql - name: check and apply configuration to group2 hosts: group2 roles: - fooapp 


Project structure


 β”œβ”€β”€ production #    - β”œβ”€β”€ stage #    stage- β”‚ β”œβ”€β”€ group_vars/ β”‚ β”œβ”€β”€ group1 #     β”‚ └── group2 #   β”œβ”€β”€ host_vars/ β”‚ β”œβ”€β”€ hostname1 #      β”‚ └── hostname2 #     β”‚ β”œβ”€β”€ site.yml #   β”œβ”€β”€ webservers.yml #   - β”œβ”€β”€ dbservers.yml #      β”‚ └── roles/ β”œβ”€β”€ common/ #    β”‚ β”œβ”€β”€ tasks/ # β”‚ β”‚ └── main.yml # -   ,    β”‚ β”‚ #   β”‚ β”œβ”€β”€ handlers/ # β”‚ β”‚ └── main.yml # -    (handlers) β”‚ β”œβ”€β”€ templates/ # -   ,   β”‚ β”‚ └── ntp.conf.j2 #  -   ntp β”‚ β”œβ”€β”€ files/ # β”‚ β”‚ β”œβ”€β”€ bar.txt # - -     β”‚ β”‚ └── foo.sh # -       β”‚ └── vars/ # β”‚ └── main.yml # -     β”‚ β”œβ”€β”€ pgsql/ #   ,  ,   pgsql └── fooapp/ #   ,  ,   fooapp 


Sample Script


, , : PostgreSQL 9.3 debian-based . .

 --- - name: install postgresql 9.3 #  playbook'a # ,  ,         vars_prompt: hosts: "Please enter hosts group name" #       (    $ANSIBLE_HOSTS) username: "Please enter username for auth" #        hosts: $hosts # user: $username sudo: True accelerate: true vars: app_username: 'app_user' #    ,      app_host_ip: '192.168.0.100' # ip-    ,         app_database_name: 'appdb' #     tasks: #       python-software-properties #     apt.  : # pkg -     # state -    , # update_cache -       - name: check add-apt-repository apt: pkg=python-software-properties state=latest update_cache=yes #    apt-  postgresql #  : # url - URL     # state -   - name: add apt key apt_key: url=http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc state=present #  ,         - name: add apt repo apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ ${ansible_lsb.codename}-pgdg main' #          - name: install pgdg-key apt: pkg=pgdg-keyring state=latest update_cache=yes #   postgresql-9.3 (    ) #  python-psycopg2 -    postgresql_user, postgresql_db, postgresql_privs - name: install packages apt: pkg=$item state=latest with_items: - postgresql-9.3 - python-psycopg2 - python-keyczar #        c  LOGIN #      credentials/_/postgres/_ - name: create postresql user for some app #        postgres (   postgresql) sudo: yes sudo_user: postgres postgresql_user: user=${app_username} password="{{ lookup('password','example/credentials/' + inventory_hostname + '/postgres/' + app_username, length=15) }}" role_attr_flags=LOGIN #            - name: create db for our app sudo: yes sudo_user: postgres action: postgresql_db name=${app_database_name} owner=${app_username} encoding='UTF8' lc_collate='en_US.UTF-8' lc_ctype='en_US.UTF-8' template='template0' state=present #      ,       - name: add app_user password to .pg_pass file on server with our app sudo: yes sudo_user: ${app_username} delegate_to: ${app_host_ip} lineinfile: dest=/home/${app_username}/.pgpass regexp='^{{ inventory_hostname }}\:\*\:${app_database_name}\:${app_username}' line='{{ inventory_hostname }}:*:${app_database_name}:${app_username}:{{ lookup('password','example/credentials/' + inventory_hostname + '/postgres/' + app_username, length=15) }}' create=yes state=present backup=yes #   pg_hba.conf ,     ip-        - name: add entry to pg_hba.conf lineinfile: dest=/etc/postgresql/9.3/main/pg_hba.conf regexp='host ${app_database_name} ${app_username} ${app_host_ip}/32 md5' line='host ${app_database_name} ${app_username} ${app_host_ip}/32 md5' state=present #   ,       postgresql #    ansible   "/ "  , #      playbook'a     notify: - reload postgres #   postgresql   localhost #     postgresql.conf  ip-  - name: add entry to postgresql lineinfile: dest=/etc/postgresql/9.3/main/postgresql.conf regexp='^listen_addresses' line="listen_addresses = '${ansible_default_ipv4.address}'" state=present #   ,      postgresql, .. #  listen_addresses      postgresql notify: - restart postgres #   handlers: #   postgresql - name: reload postgres sudo: yes action: service name=postgresql state=reloaded #  postgresql - name: restart postgres sudo: yes action: service name=postgresql state=restarted 



Ansible AWX


Ansible . Ansibleworks AWX , . , : ( 10) , β€” . β€” Puppet Chef .

Conclusion


Ansible β€” , . , . Ansible . .

β€” :

https://github.com/ansible/ β€” github c

http://www.ansibleworks.com/docs/ β€” ( );

http://jpmens.net/2012/06/06/configuration-management-with-ansible/ β€” Ansible ( ).

https://gist.github.com/marktheunissen/2979474 β€” , .

www.ansibleworks.com/docs/contrib.html β€” , .

For those who can not comment on posts on HabrΓ©, we invite to our blog .

Source: https://habr.com/ru/post/196620/


All Articles