Commit Graph

105 Commits (93baccce0165247f19c9dabcae9a0b549fe415ab)

Author SHA1 Message Date
James Martin b99beba5e7 Using "OtherLinux" in module_commons, cleander detection in setup. 12 years ago
James Martin 458c50e7a3 Support for amazon linux distribution facts. 12 years ago
Daniel Hokka Zakrisson 2402bae9ea Clean up device fact gathering
Remove lots of re use that really shouldn't have been re in the first
place. Initialize pcidata even if lspci is unavailable, and check for
its usability before trying to use it.

Fixes #2060.
12 years ago
Kavin Kankeshwar 4f0f946211 Fixing logical error in detecting virtual device.
So In my Centos 5.9 machine, if there is RAID mount ansible will crash, as it cannot find scheduler file. The reason being, this should be a virtual device as there is no "device" folder under e.g. /sys/block/md0/

Here is the crash:

[kk@u1 ansible]$ ansible q3 -m setup -k -u root --tree=/tmp/facts
SSH password:
q3 | FAILED => failed to parse: /sys/block/md0
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 1797, in ?
    main()
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 1050, in main
    data = run_setup(module)
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 1000, in run_setup
    facts = ansible_facts()
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 990, in ansible_facts
    facts.update(Hardware().populate())
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 312, in populate
    self.get_device_facts()
  File "/root/.ansible/tmp/ansible-1360629441.14-171498703486275/setup", line 439, in get_device_facts
    m = re.match(".*?(\[(.*)\])", scheduler)
  File "/usr/lib64/python2.4/sre.py", line 129, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or buffer
12 years ago
Daniel Hokka Zakrisson e8279f0513 Fix setup when /sys/block is inaccessible 12 years ago
Daniel Hokka Zakrisson 75651da37c Fixes for Python 2.4 12 years ago
Brian Coca 775b8a9643 added block device info gathering, full for linux, partial for freebsd added prettyfing byte function Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
moved moutns out of devices Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
12 years ago
Michael DeHaan 1bbe06f92e This implements a basic --check mode which for now is only implemented on template & copy operations. More detail will be shared with the list
shortly.
12 years ago
Shaun Zinck 6a879562b6 add pkgin to list of package managers in setup 12 years ago
John Gosset a858d1a816 add pacman to list of package managers in setup module 12 years ago
Stephen Fromm e4964f42e0 Update modules to use run_command in module_common.py
This updates apt, apt_repository, command, cron, easy_install, facter,
fireball, git, group, mount, ohai, pip, service, setup, subversion,
supervisorctl, svr4pkg, user, and yum to take advantage of run_command
in module_common.py.
12 years ago
Daniel Hokka Zakrisson 360701ea43 Handle unreadable /proc/xen/capabilities
Fixes #1854.
12 years ago
Michael DeHaan 4301a33b97 Streamline code 12 years ago
Michael DeHaan d75681abdc Merge pull request #1656 from dagwieers/setup-virtualization
Implemented more virtualization types
12 years ago
Dag Wieers f572824c5c Implemented more virtualization types
I added all known virtualization types from the virt-what project. However, the few virt types that rely on cpuid information have not been implemented lacking native python cpuid access. (hyperv)
12 years ago
Jan-Piet Mens d184f72aa9 DOCUMENTATION strings 12 years ago
Michael DeHaan 6f6559670f chmod -x for all module files in source checkout 12 years ago
Fabian Arrotin 1151381ab1 Fixed the way dom0/domU xen role is defined in the setup module 12 years ago
Michael DeHaan 78669c57d5 Module documentation should have options sorted 12 years ago
Michael DeHaan 8d3f73d562 pep8 fixes 12 years ago
Michael DeHaan 958b2909f8 Rename 'domainname' to 'domain' 12 years ago
Serge van Ginderachter 4ebea7acba Add domainname to ansible facts 12 years ago
Brian Coca 9d1645cbe3 fixed but in pulling data from dmesg command, wrong function to use as file for for loop
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
12 years ago
Brian Coca 7ba232479e small patch to fact gathering for when no dmesg.boot exists on freebsd, mainly happens in jails
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
12 years ago
Michael DeHaan 3e560234bc Fix typo in autogenerated docs 12 years ago
Jan-Piet Mens a790c399f4 Added attribution to all module DOCUMENTATION strings 12 years ago
Stephen Fromm c0d2d76fe9 Add LSB facts, as derived from lsb_release -a
This gathers LSB facts via lsb_release.  This complements the
platform facts collected via the platform module.  This reoprts
release, id, description, release, and codename.  It also adds
'major_release', which is the major version number of a distribution.
12 years ago
Jan-Piet Mens af1f925eea Tweak DOCUMENTATION YAML as per latest 991 12 years ago
Michael DeHaan 26f8b30653 Merge pull request #1054 from jpmens/geturl_doc1
First attempt at standardizing DOCUMENTATION string
12 years ago
Jan-Piet Mens 952a82cca0 First attempt at standardizing DOCUMENTATION string (new DICT) 12 years ago
Michael DeHaan 9f417e3502 Merge pull request #1052 from romeotheriault/add-SunOSVirtual-facts
Adding SunOSVirtual facts
12 years ago
Romeo Theriault 62f1347f69 Adding SunOSVirtual facts 12 years ago
Stephen Fromm dc8c0ea467 Update package manager fact innards to a list of dicts 12 years ago
Stephen Fromm 6e7b94ad32 Add pkg_mgr fact to setup
This should help facilitate playbook decision making that are not
strictly distribution specific, but more package manager.
12 years ago
Matt Coddington 3102ca41a7 make this python24 compatible 12 years ago
Michael DeHaan a3b67ec039 Merge pull request #1005 from dagwieers/cmdline
Add /proc/cmdline information to the default facts
12 years ago
Jan-Piet Mens cbcd04b692 Add support for RSA/DSA SSH host key detection in setup module for OS/X
s/<8spaces>/<4spaces>/g
12 years ago
Dag Wieers cabbb9fce7 Add /proc/cmdline information to the default facts
The use-case here is that based on information in the /proc/cmdline certain actions can be taken.

A practical example in our case is that we have a play at the end of the provisioning phase that reboots the system. Since we don't want to accidentally reboot a system (or restart the network) on a production machine, having a way to separate an Anaconda post-install (sshd in chroot) with a normal system is a good way to make that distinction.

    ---
    - name: reboot
      hosts: all
      tasks:
      - action: command init 6
        only_if: "not '${ansible_cmdline.BOOT_IMAGE}'.startswith('$')"

A practical problem here is the fact that we cannot simply check whether it is set or empty:

    ---
    - name: reboot
      hosts: all
      tasks:
      - action: command init 6
        only_if: "'${ansible_cmdline.BOOT_IMAGE}'"

If ansible_cmdline was a string, a simple only_if: "'${ansible_cmdline}'.find(' BOOT_IMAGE=')" was an option, but still not very "beautiful" :-/

This implementation uses shlex.split() and uses split(sep, maxsplit=1).
12 years ago
Michael DeHaan 08a3079166 Check for ipv6 12 years ago
Michael DeHaan b0dc015a13 Always pipe stderr in the setup module to avoid JSON interference. 12 years ago
Stephen Fromm f0da6b191a Migrate remaining modules to use get_bin_path in module_common.py
* Migraed easy_install, pip, service, setup, and user.
* Updated fail_json message in apt_repository
* Fixed easy_install to not hardcode location of virtualenv in
  /usr/local/bin/.
* Made handling of virtualenv more consistent between easy_install and
  pip.
12 years ago
Michael DeHaan d426afcfb2 Merge branch 'setup-no-dash-facts' of https://github.com/tima/ansible into devel
Conflicts:
	library/setup
12 years ago
Timothy Appnel d170c51545 Replace - with _ in setup module key names to avoid variable access problems reported in #954 12 years ago
Maxim Burgerhout f9410c94d7 Add working CPU model fact for some ARM devices
Works on Sheevaplug, probably works on Rasberry Pi as well
12 years ago
Tim Bielawa 23ec079661 Fix setup module explosion when a route is empty. Closes #909 12 years ago
Daniel Hokka Zakrisson d1568b1ebb Work with tun and p2p interfaces 12 years ago
Sundar Raman 62e082a1c7 (Re #882) Handle errors in get_interfaces
If there is an error in how interfaces are configured (or only one set, like IPv6),
the setup command should not error out.
12 years ago
Michael DeHaan a102507a5c Merge pull request #866 from akhayyat/devel
setup: add type and default_ipv{4,6} to linux network facts
12 years ago
Daniel Hokka Zakrisson e79667bcad Fix spelling of architecture for non-x86 12 years ago
Ahmad Khayyat a9ebe9cb2b setup: add type and default_ipv{4,6} to linux network facts 12 years ago