Commit graph

24 commits

Author SHA1 Message Date
Michael DeHaan
1c9b43df1b more whitespace 2012-08-06 21:00:21 -04:00
Michael DeHaan
fe558f680a Fix some failing tests, script tests seem to indicate magic variables are not being provided
to scripted inventory so need to investigate this.
2012-07-30 19:21:49 -04:00
Chin Fang
e3b2521f01 Added a host expansion feature to ansible's inventory parsing 2012-07-24 12:38:52 -07:00
Michael DeHaan
dde11baa56 Remove YAML inventory tests since this is now deprecated. 2012-07-20 11:31:28 -04:00
Michael DeHaan
60f295f7a0 Squashed commit of the following:
commit 4430ce3eefcdff0b0ceffea0ef66ea8e876a807d
Merge: 631783b 649963c
Author: Michael DeHaan <michael.dehaan@gmail.com>
Date:   Thu Jul 12 01:28:43 2012 -0400

    Merge branch 'host-groups' of https://github.com/dagwieers/ansible into daggroups

commit 649963ca2c
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 23:01:00 2012 +0200

    Added comments in the example yaml file as requested

commit 7f9718f185
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 22:49:38 2012 +0200

    Add the default nose color too, to test specific overrides

commit eb63b9e899
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 22:44:35 2012 +0200

    Introduce comics and cartoons to test yaml groups defined on a per-node basis

commit aa13d23307
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 19:33:15 2012 +0200

    A small fix to revert to old state

commit 264ebaa77c
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 19:31:51 2012 +0200

    Combine both yaml unit tests into one example file

commit 7db49a8048
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 16:46:53 2012 +0200

    Might as well fix this too

commit f36c6c8c5b
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 16:42:00 2012 +0200

    Added unit tests for host-groups patch

    For the unit test I chose to keep the original yaml file in place as a reference.

    This patch also includes a fix.

commit a96f681352
Author: Dag Wieërs <dag@wieers.com>
Date:   Thu Jul 12 12:30:43 2012 +0200

    Allow groups to be defined on a per-host basis

    This makes it possible to define on a per-host basis what groups a host is in.
    When managing a large set of systems it makes it easier to ensure each of the
    systems is defined in a set of groups (e.g. production/qa/development,
    linux/solaris/aix) rather than having to add systems to multiple disconnected
    groups.

    ----
      - host: system01

      - host: system02

      - host: system03

      - group: linux
        hosts:
        - system01
        - system02

      - group: solaris
        hosts:
        - system03

      - group: production
        hosts:
        - system01
        - system03

      - group: qa
        - system02

      - group: dbserver
        hosts:
        - system01

      - group: ntpserver
        hosts:
        - system02

      - group: webserver
        - system03
    ----

    Can be redefined as:

    ----
      - host: system01
        groups: [ linux, production, dbserver ]

      - host: system02
        groups: [ linux, qa, ntpserver ]

      - host: system03
        groups: [ solaris, production, webserver ]
    ----
2012-07-12 01:29:51 -04:00
Jeroen Hoekx
d592e15dcc Correctly add ungrouped hosts to 'ungrouped' in YAML inventory. 2012-06-27 08:26:01 +02:00
Daniel Hokka Zakrisson
05a7a3725b Add tests of host exclusions 2012-06-15 19:09:04 +02:00
Michael DeHaan
8e88667f82 Fix hosts being in multiple groups, and duplicate host references in the same inventory file. 2012-05-19 17:24:54 -04:00
Jeroen Hoekx
e09572a8e1 Inventory: undefined group -> ungrouped.
Also change test name collision.
2012-05-08 09:44:59 +02:00
Jeroen Hoekx
d419a13ca7 Inventory: support list of vars in host. 2012-05-08 09:44:29 +02:00
Michael DeHaan
157d21b1c3 Add tests for new advanced inventory features (groups of groups, group variables) in the default INI format file. 2012-05-06 18:01:11 -04:00
Michael DeHaan
1a00e2635e Further work on making the YAML inventory parser use the new inventory objects. 2012-05-06 17:03:17 -04:00
Michael DeHaan
256377166a Reinstate external inventory script support this time using the new more OO-ey inventory system.
Next up: YAML format.
2012-05-06 14:47:05 -04:00
Michael DeHaan
0669ce858a Refactored inventory to make it object oriented, need to make YAML format and executable script
format compatible with this still, and add some tests for INI-style groups of groups
and variables.
2012-05-05 16:31:03 -04:00
Jeroen Hoekx
03541baba7 Define 'inventory_hostname' variable for hosts. 2012-05-02 09:56:58 +02:00
Jeroen Hoekx
b87710a1df Introduce group_names in template variables.
This is a list of all the groups a host is in.
2012-04-28 18:23:44 +02:00
Jeroen Hoekx
903e4f6eae Support dicts in inventory vars. 2012-04-19 09:40:17 +02:00
Michael DeHaan
9ce27be878 Remove extra_vars tests 2012-04-16 23:03:04 -04:00
Jeroen Hoekx
8c3206c99f Return a copy of the host variables. 2012-04-16 10:59:34 +02:00
Jeroen Hoekx
961ccdb2f4 List hosts in no group in the ungrouped group. 2012-04-16 10:55:08 +02:00
Jeroen Hoekx
3a24aa9a70 Add YAML inventory format.
See test/yaml_hosts for an example.

Hosts can be part of multiple groups.

Groups can also have variables, inherited by the hosts.
There is no variable scope, last variable seen wins.
2012-04-16 10:38:35 +02:00
Jeroen Hoekx
54f4526160 Export SSH port number as host variable. 2012-04-16 09:16:29 +02:00
Jeroen Hoekx
746f1b92ae Reimplement the class method on Runner. 2012-04-16 09:16:29 +02:00
Jeroen Hoekx
195e6d617b Add tests for Inventory class. 2012-04-16 09:16:29 +02:00