@ -14,8 +14,10 @@
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
"""
from __future__ import ( absolute_import , division , print_function )
DOCUMENTATION :
__metaclass__ = type
DOCUMENTATION = """
lookup : cartesian
lookup : cartesian
version_added : " 2.1 "
version_added : " 2.1 "
short_description : returns the cartesian product of lists
short_description : returns the cartesian product of lists
@ -26,7 +28,9 @@ DOCUMENTATION:
description :
description :
- a set of lists
- a set of lists
required : True
required : True
EXAMPLES :
"""
EXAMPLES = """
- name : outputs the cartesian product of the supplied lists
- name : outputs the cartesian product of the supplied lists
debug : msg = " {{ item}} "
debug : msg = " {{ item}} "
@ -35,15 +39,14 @@ EXAMPLES:
- " {{ list2}} "
- " {{ list2}} "
- name : used as lookup changes [ 1 , 2 , 3 ] , [ a , b ] into [ 1 , a ] , [ 1 , b ] , [ 2 , a ] , [ 2 , b ] , [ 3 , a ] , [ 3 , b ]
- name : used as lookup changes [ 1 , 2 , 3 ] , [ a , b ] into [ 1 , a ] , [ 1 , b ] , [ 2 , a ] , [ 2 , b ] , [ 3 , a ] , [ 3 , b ]
debug : msg = " {{ [1,2,3]|lookup( ' cartesian ' , [a, b])}} "
debug : msg = " {{ [1,2,3]|lookup( ' cartesian ' , [a, b])}} "
"""
RETURN :
RETURN = """
_list :
_list :
description :
description :
- list of lists composed of elements of the input lists
- list of lists composed of elements of the input lists
type : lists
type : lists
"""
"""
from __future__ import ( absolute_import , division , print_function )
__metaclass__ = type
from itertools import product
from itertools import product