get_interfaces() updated to read /proc/net/dev. This means it no
longer provides only interfaces that are up.
get_iface_hwaddr() updated to read from /sys/class/net/<iface>/address.
Added get_interface_facts() to pull in mac address and interface mtu.
Can be used later for additional interface-facts.
Added get_ipv6_facts(), which reads from /proc/net/if_inet6.
get_network_facts() renamed to get_ipv4_facts(). It still calls
ifconfig to determine ipv4 facts.
The Facts class and subclasses no longer take a dict argument for
instantiation. populate() now returns self.facts.
Other changes:
- Facts.__init__() takes over most of the work from populate() so that
subclasses can benefit from its knowledge.
- Drop setting unknown facts to 'NA' in __init__() in various
subclasses.
- Check for presence of facts in get_virtual_facts()
- Update ansible_facts() to use facts.update(<classname>().populate())
This changes and organizes facts into a base class Facts and several
sub classes that implement the necessary functionality. The classes
are:
- Facts: base class. Implements basic facts that should be common to a
number of platforms. It is also where SSH keys and SELinux facts are
set.
- Hardware: A subclass of Facts that should be further
subclassed per platform for CPU, memory, and related facts.
- LinuxHardware: subclass of Hardware for Linux platforms
- SunOSHardware: subclass of Hardware for SunOS platforms
- FreeBSDHardware: subclass of Hardware for FreeBSD
- Network: A subclass of Facts that that should be further
subclassed per platform for IP, both IPv4 and IPv6, information.
- LinuxNetwork: Currently only implementation for determining network
facts.
- Virtual: A subclass of Facts that that should be further
subclassed per platform to determine virtual environment facts.
- LinuxVirtual: Currently only implementation for determining virtual
facts.
If facts are needed for additional platforms, one of the above classes
(eg Network) can be further subclassed and implement the necessary
functionality.
In addition, it fixes get_network_facts() to work on Fedora17. That
broke due to changes to ifconfig output.
This flag will show playbook output from non-failing commands. -v is also added to /usr/bin/ansible, but not yet used.
I also gutted some internals code dealing with 'invocations' which allowed the callback to know what module invoked
it. This is not something 0.5 does or needed, so callbacks have been simplified.
Tested with OS X local connection and Linux remote. The paths to the
md5sum and md5 commands are hardcoded to the most common location. This
will definitely fail if the commands are elsewhere, or if the md5
command doesn't support the -q 'quiet' option.
This switches to using selinux library calls instead of parsing the
output of sestatus. This fixes issue #428 where the output was slightly
different than expected on F17. Tested against debian (non-selinux),
centos5, centos6, and fedora17.
The ohai and facter modules use /usr/bin/logger to log the fact that
they have been invoked. I added 'import os' to the ping module
so that it could have the same syslog statements as the other modules.
I separated the condensed:
shlex.split(open(argfile, 'r').read())
into two separate statements similar to the other modules.
This collects various facts from the host so that it isn't necessary to
have facter or ohai installed. It gets various platform/distribution
facts, information about the type of hardware, whether a virtual
environment and what type, assorted interface facts, and ssh host public
keys. Most facts are flat. The two exceptions are 'processor' and all
interface facts. Interface facts are presented as:
ansible_lo : {
"macaddress": "00:00:00:00:00:00",
"ipv4": { "address": "127.0.0.1", "netmask": "255.0.0.0" },
"ipv6": [
{ "address": "::1", "prefix": "128", "scope": "host" }
]
}
as well as template files. PLUS, variables are now expressed in playbooks without having
to know about the setup task, which means playbooks are simpler to read now.