Browse code

Move v2 out of the package tree so it does not yet appear.

Michael DeHaan authored on 2014/10/03 02:47:25
Showing 71 changed files
... ...
@@ -94,7 +94,7 @@ tests:
94 94
 	PYTHONPATH=./lib $(NOSETESTS) -d -w test/units -v
95 95
 
96 96
 newtests:
97
-	PYTHONPATH=./lib/v2/ $(NOSETESTS) -d -w lib/v2/tests -v
97
+	PYTHONPATH=./v2/ $(NOSETESTS) -d -w v2/tests -v
98 98
 
99 99
 
100 100
 authors:
101 101
deleted file mode 100644
... ...
@@ -1,19 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-__version__ = '1.8'
19
-__author__ = 'Michael DeHaan'
20 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,19 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-class AnsibleError(Exception):
19
-     pass
20 1
deleted file mode 100644
... ...
@@ -1,26 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-class Inventory(object):
19
-    def __init__(self):
20
-        pass
21
-
22
-    def get_hosts(self):
23
-        return []
24
-
25
-    def get_groups(self):
26
-        return []
27 1
deleted file mode 100644
... ...
@@ -1,44 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-class Group(object):
19
-    def __init__(self, name, hosts=[]):
20
-        self.name     = name
21
-        self.hosts    = hosts
22
-        self.parents  = []
23
-        self.children = []
24
-
25
-    def get_vars(self):
26
-        return dict()
27
-
28
-    def get_hosts(self):
29
-        return self.hosts
30
-
31
-    def get_direct_subgroups(self):
32
-        direct_children = []
33
-        for child in self.children:
34
-            direct_children.append(child.name)
35
-        return direct_children
36
-
37
-    def get_all_subgroups(self):
38
-        all_children = []
39
-        for child in self.children:
40
-            all_children.extend(child.get_all_subgroups())
41
-        return all_children
42
-
43
-    def get_parent_groups(self):
44
-        return self.parents
45 1
deleted file mode 100644
... ...
@@ -1,27 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-class Host(object):
19
-    def __init__(self, name):
20
-        self.name   = name
21
-        self.groups = []
22
-
23
-    def get_vars(self):
24
-        return dict()
25
-
26
-    def get_groups(self):
27
-        return self.groups
28 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-from v2.inventory import Host, Group
19
-
20
-class HostPattern(object):
21
-    def __init__(self, pattern):
22
-        self.pattern = pattern
23
-
24
-    def match(thing):
25
-        '''
26
-        return a list of matches
27
-        '''
28
-
29
-        matches = []
30
-        if isinstance(thing, Host):
31
-            # simple match against a single host
32
-            pass
33
-        elif isinstance(thing, Group):
34
-            # match against the list of hosts in the group
35
-            pass
36
-        return matches
37 1
deleted file mode 100644
... ...
@@ -1,30 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-import v2.utils
19
-
20
-class Playbook(object):
21
-    def __init__(self, filename):
22
-        self.ds = v2.utils.load_yaml_from_file(filename)
23
-        self.plays = []
24
-
25
-    def load(self):
26
-        # loads a list of plays from the parsed ds
27
-        self.plays = []
28
-
29
-    def get_plays(self):
30
-        return self.plays
31 1
deleted file mode 100644
... ...
@@ -1,22 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-class Base(object):
19
-
20
-   def __init__(self):
21
-       pass
22
-
23 1
deleted file mode 100644
... ...
@@ -1,24 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-from v2.playbook.base import PlaybookBase
19
-
20
-class Block(PlaybookBase):
21
-
22
-    def __init__(self):
23
-        pass
24
-
25 1
deleted file mode 100644
... ...
@@ -1,29 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-import v2.config as C
19
-from v2.utils import template
20
-from v2.utils import list_union
21
-
22
-class Conditional(object):
23
-
24
-    def __init__(self, task):
25
-        pass
26
-
27
-    def evaluate(self, context):
28
-        pass
29
-
30 1
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-from v2.errors import AnsibleError
19
-from v2.inventory import Host
20
-from v2.playbook import Task
21
-
22
-class Handler(Task):
23
-
24
-    def __init__(self):
25
-        pass
26
-
27
-    def flag_for_host(self, host):
28
-        assert instanceof(host, Host)
29
-        pass
30
-
31
-    def has_triggered(self):
32
-        return self._triggered
33
-
34
-    def set_triggered(self, triggered):
35
-        assert instanceof(triggered, bool)
36
-        self._triggered = triggered
37 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,58 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-from v2.playbook.base import PlaybookBase
19
-from v2.utils import list_union
20
-
21
-class Role(PlaybookBase):
22
-
23
-    def __init__(self):
24
-        pass
25
-
26
-    def load(self, ds):
27
-        self._ds = ds
28
-        self._tasks = []
29
-        self._handlers = []
30
-        self._blocks = []
31
-        self._dependencies = []
32
-        self._metadata = dict()
33
-        self._defaults = dict()
34
-        self._vars = dict()
35
-        self._params = dict()
36
-
37
-    def get_vars(self):
38
-        # returns the merged variables for this role, including
39
-        # recursively merging those of all child roles
40
-        return dict()
41
-
42
-    def get_immediate_dependencies(self):
43
-        return self._dependencies
44
-
45
-    def get_all_dependencies(self):
46
-        # returns a list built recursively, of all deps from
47
-        # all child dependencies
48
-        all_deps = []
49
-        for dep in self._dependencies:
50
-            list_union(all_deps, dep.get_all_dependencies())
51
-        all_deps = list_union(all_deps, self.dependencies)
52
-        return all_deps
53
-
54
-    def get_blocks(self):
55
-        # should return 
56
-        return self.blocks
57
-
58
-
59 1
deleted file mode 100644
... ...
@@ -1,45 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-from v2.errors import AnsibleError
19
-from v2.utils import list_union
20
-
21
-class Tag(object):
22
-    def __init__(self, tags=[]):
23
-        self.tags = tags
24
-
25
-    def push(self, tag):
26
-        if tag not in self.tags:
27
-            self.tags.append(tag)
28
-
29
-    def get_tags(self):
30
-        return self.tags
31
-
32
-    def merge(self, tags):
33
-        # returns a union of the tags, which can be a string,
34
-        # a list of strings, or another Tag() class
35
-        if isinstance(tags, basestring):
36
-            tags = Tag([tags])
37
-        elif isinstance(tags, list):
38
-            tags = Tag(tags)
39
-        elif not isinstance(tags, Tag):
40
-            raise AnsibleError('expected a Tag() instance, instead got %s' % type(tags))
41
-        return utils.list_union(self.tags, tags.get_tags())
42
-
43
-    def matches(self, tag):
44
-        return tag in self.tags
45
-        
46 1
deleted file mode 100644
... ...
@@ -1,38 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-from v2.playbook.base import PlaybookBase
19
-
20
-class Task(PlaybookBase):
21
-    def __init__(self, block=None, role=None):
22
-        self.ds    = None
23
-        self.block = block
24
-        self.role  = role
25
-
26
-    def load(self, ds):
27
-        self.ds = ds
28
-        self.name = ""
29
-
30
-    def get_vars(self):
31
-        return dict()
32
-
33
-    def get_role(self):
34
-        return self.role
35
-
36
-    def get_block(self):
37
-        return self.block
38
-
39 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18 1
deleted file mode 100644
... ...
@@ -1,22 +0,0 @@
1
-# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
2
-#
3
-# This file is part of Ansible
4
-#
5
-# Ansible is free software: you can redistribute it and/or modify
6
-# it under the terms of the GNU General Public License as published by
7
-# the Free Software Foundation, either version 3 of the License, or
8
-# (at your option) any later version.
9
-#
10
-# Ansible is distributed in the hope that it will be useful,
11
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
-# GNU General Public License for more details.
14
-#
15
-# You should have received a copy of the GNU General Public License
16
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
17
-
18
-from v2.inventory import Host
19
-from v2.playbook import Task
20
-
21
-class Runner(object):
22
-   pass
23 1
new file mode 100644
... ...
@@ -0,0 +1,19 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+__version__ = '1.8'
18
+__author__ = 'Michael DeHaan'
0 19
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,19 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+class AnsibleError(Exception):
18
+     pass
0 19
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+class Inventory(object):
18
+    def __init__(self):
19
+        pass
20
+
21
+    def get_hosts(self):
22
+        return []
23
+
24
+    def get_groups(self):
25
+        return []
0 26
new file mode 100644
... ...
@@ -0,0 +1,44 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+class Group(object):
18
+    def __init__(self, name, hosts=[]):
19
+        self.name     = name
20
+        self.hosts    = hosts
21
+        self.parents  = []
22
+        self.children = []
23
+
24
+    def get_vars(self):
25
+        return dict()
26
+
27
+    def get_hosts(self):
28
+        return self.hosts
29
+
30
+    def get_direct_subgroups(self):
31
+        direct_children = []
32
+        for child in self.children:
33
+            direct_children.append(child.name)
34
+        return direct_children
35
+
36
+    def get_all_subgroups(self):
37
+        all_children = []
38
+        for child in self.children:
39
+            all_children.extend(child.get_all_subgroups())
40
+        return all_children
41
+
42
+    def get_parent_groups(self):
43
+        return self.parents
0 44
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+class Host(object):
18
+    def __init__(self, name):
19
+        self.name   = name
20
+        self.groups = []
21
+
22
+    def get_vars(self):
23
+        return dict()
24
+
25
+    def get_groups(self):
26
+        return self.groups
0 27
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+from v2.inventory import Host, Group
18
+
19
+class HostPattern(object):
20
+    def __init__(self, pattern):
21
+        self.pattern = pattern
22
+
23
+    def match(thing):
24
+        '''
25
+        return a list of matches
26
+        '''
27
+
28
+        matches = []
29
+        if isinstance(thing, Host):
30
+            # simple match against a single host
31
+            pass
32
+        elif isinstance(thing, Group):
33
+            # match against the list of hosts in the group
34
+            pass
35
+        return matches
0 36
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+import v2.utils
18
+
19
+class Playbook(object):
20
+    def __init__(self, filename):
21
+        self.ds = v2.utils.load_yaml_from_file(filename)
22
+        self.plays = []
23
+
24
+    def load(self):
25
+        # loads a list of plays from the parsed ds
26
+        self.plays = []
27
+
28
+    def get_plays(self):
29
+        return self.plays
0 30
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+class Base(object):
18
+
19
+   def __init__(self):
20
+       pass
21
+
0 22
new file mode 100644
... ...
@@ -0,0 +1,24 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+from v2.playbook.base import PlaybookBase
18
+
19
+class Block(PlaybookBase):
20
+
21
+    def __init__(self):
22
+        pass
23
+
0 24
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+import v2.config as C
18
+from v2.utils import template
19
+from v2.utils import list_union
20
+
21
+class Conditional(object):
22
+
23
+    def __init__(self, task):
24
+        pass
25
+
26
+    def evaluate(self, context):
27
+        pass
28
+
0 29
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+from v2.errors import AnsibleError
18
+from v2.inventory import Host
19
+from v2.playbook import Task
20
+
21
+class Handler(Task):
22
+
23
+    def __init__(self):
24
+        pass
25
+
26
+    def flag_for_host(self, host):
27
+        assert instanceof(host, Host)
28
+        pass
29
+
30
+    def has_triggered(self):
31
+        return self._triggered
32
+
33
+    def set_triggered(self, triggered):
34
+        assert instanceof(triggered, bool)
35
+        self._triggered = triggered
0 36
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,58 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+from v2.playbook.base import PlaybookBase
18
+from v2.utils import list_union
19
+
20
+class Role(PlaybookBase):
21
+
22
+    def __init__(self):
23
+        pass
24
+
25
+    def load(self, ds):
26
+        self._ds = ds
27
+        self._tasks = []
28
+        self._handlers = []
29
+        self._blocks = []
30
+        self._dependencies = []
31
+        self._metadata = dict()
32
+        self._defaults = dict()
33
+        self._vars = dict()
34
+        self._params = dict()
35
+
36
+    def get_vars(self):
37
+        # returns the merged variables for this role, including
38
+        # recursively merging those of all child roles
39
+        return dict()
40
+
41
+    def get_immediate_dependencies(self):
42
+        return self._dependencies
43
+
44
+    def get_all_dependencies(self):
45
+        # returns a list built recursively, of all deps from
46
+        # all child dependencies
47
+        all_deps = []
48
+        for dep in self._dependencies:
49
+            list_union(all_deps, dep.get_all_dependencies())
50
+        all_deps = list_union(all_deps, self.dependencies)
51
+        return all_deps
52
+
53
+    def get_blocks(self):
54
+        # should return 
55
+        return self.blocks
56
+
57
+
0 58
new file mode 100644
... ...
@@ -0,0 +1,45 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+from v2.errors import AnsibleError
18
+from v2.utils import list_union
19
+
20
+class Tag(object):
21
+    def __init__(self, tags=[]):
22
+        self.tags = tags
23
+
24
+    def push(self, tag):
25
+        if tag not in self.tags:
26
+            self.tags.append(tag)
27
+
28
+    def get_tags(self):
29
+        return self.tags
30
+
31
+    def merge(self, tags):
32
+        # returns a union of the tags, which can be a string,
33
+        # a list of strings, or another Tag() class
34
+        if isinstance(tags, basestring):
35
+            tags = Tag([tags])
36
+        elif isinstance(tags, list):
37
+            tags = Tag(tags)
38
+        elif not isinstance(tags, Tag):
39
+            raise AnsibleError('expected a Tag() instance, instead got %s' % type(tags))
40
+        return utils.list_union(self.tags, tags.get_tags())
41
+
42
+    def matches(self, tag):
43
+        return tag in self.tags
44
+        
0 45
new file mode 100644
... ...
@@ -0,0 +1,38 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+from v2.playbook.base import PlaybookBase
18
+
19
+class Task(PlaybookBase):
20
+    def __init__(self, block=None, role=None):
21
+        self.ds    = None
22
+        self.block = block
23
+        self.role  = role
24
+
25
+    def load(self, ds):
26
+        self.ds = ds
27
+        self.name = ""
28
+
29
+    def get_vars(self):
30
+        return dict()
31
+
32
+    def get_role(self):
33
+        return self.role
34
+
35
+    def get_block(self):
36
+        return self.block
37
+
0 38
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
0 17
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
1
+#
2
+# This file is part of Ansible
3
+#
4
+# Ansible is free software: you can redistribute it and/or modify
5
+# it under the terms of the GNU General Public License as published by
6
+# the Free Software Foundation, either version 3 of the License, or
7
+# (at your option) any later version.
8
+#
9
+# Ansible is distributed in the hope that it will be useful,
10
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+# GNU General Public License for more details.
13
+#
14
+# You should have received a copy of the GNU General Public License
15
+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
16
+
17
+from v2.inventory import Host
18
+from v2.playbook import Task
19
+
20
+class Runner(object):
21
+   pass