??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó
àUdac @` sÕ d d l m Z m Z m Z e Z d Z d Z d Z d d l m
Z m Z d d l
m Z d d l m Z d d l m Z d d l m Z d
Z e d e d e d
e d d e ƒ Z d e f d „ ƒ YZ d S( i ( t absolute_importt divisiont print_functions
lookup: sequence
author: Jayson Vantuyl
version_added: "1.0"
short_description: generate a list based on a number sequence
description:
- generates a sequence of items. You can specify a start value, an end value, an optional "stride" value that specifies the number of steps
to increment the sequence, and an optional printf-style format string.
- 'Arguments can be specified as key=value pair strings or as a shortcut form of the arguments string is also accepted: [start-]end[/stride][:format].'
- 'Numerical values can be specified in decimal, hexadecimal (0x3f8) or octal (0600).'
- Starting at version 1.9.2, negative strides are allowed.
- Generated items are strings. Use Jinja2 filters to convert items to preferred type, e.g. ``{{ 1 + item|int }}``.
- See also Jinja2 ``range`` filter as an alternative.
options:
start:
description: number at which to start the sequence
default: 0
type: number
end:
description: number at which to end the sequence, dont use this with count
type: number
default: 0
count:
description: number of elements in the sequence, this is not to be used with end
type: number
default: 0
stride:
description: increments between sequence numbers, the default is 1 unless the end is less than the start, then it is -1.
type: number
format:
description: return a string with the generated number formatted in
sH
- name: create some test users
user:
name: "{{ item }}"
state: present
groups: "evens"
with_sequence: start=0 end=32 format=testuser%02x
- name: create a series of directories with even numbers for some reason
file:
dest: "/var/stuff/{{ item }}"
state: directory
with_sequence: start=4 end=16 stride=2
- name: a simpler way to use the sequence plugin create 4 groups
group:
name: "group{{ item }}"
state: present
with_sequence: count=4
- name: the final countdown
debug: msg={{item}} seconds to detonation
with_sequence: end=0 start=10
s`
_list:
description:
- A list containing generated sequence of items
type: list
( t compilet
IGNORECASE( t AnsibleError( t xrange( t parse_kv( t
LookupBases (0?x?[0-9a-f]+)s ^(s -)?s (/s )?s (:(.+))?$t LookupModulec B` sD e Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( s{
sequence lookup module
Used to generate some sequence of items. Takes arguments in two forms.
The simple / shortcut form is:
[start-]end[/stride][:format]
As indicated by the brackets: start, stride, and format string are all
optional. The format string is in the style of printf. This can be used
to pad with zeros, format in hexadecimal, etc. All of the numerical values
can be specified in octal (i.e. 0664) or hexadecimal (i.e. 0x3f8).
Negative numbers are not supported.
Some examples:
5 -> ["1","2","3","4","5"]
5-8 -> ["5", "6", "7", "8"]
2-10/2 -> ["2", "4", "6", "8", "10"]
4:host%02d -> ["host01","host02","host03","host04"]
The standard Ansible key-value form is accepted as well. For example:
start=5 end=11 stride=2 format=0x%02x -> ["0x05","0x07","0x09","0x0a"]
This format takes an alternate form of "end" called "count", which counts
some number from the starting value. For example:
count=5 -> ["1", "2", "3", "4", "5"]
start=0x0f00 count=4 format=%04x -> ["0f00", "0f01", "0f02", "0f03"]
start=0 count=5 stride=2 -> ["0", "2", "4", "6", "8"]
start=1 count=5 stride=2 -> ["1", "3", "5", "7", "9"]
The count option is mostly useful for avoiding off-by-one errors and errors
calculating the number of entries in a sequence when a stride is specified.
c C` s1 d | _ d | _ d | _ d | _ d | _ d S( s set sensible defaultsi s %dN( t startt Nonet countt endt stridet format( t self( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/lookup/sequence.pyt reset† s
c C` sÒ x‹ d d d d g D]w } yG | j | d ƒ } | d k r@ w n t | d ƒ } t | | | ƒ Wq t k
r‰ t d | | f ƒ ‚ q Xq Wd | k r¯ | j d ƒ | _ n | rÎ t d | j ƒ ƒ ‚ n d S(
s parse key-value style argumentsR
R
R R i s can't parse arg %s=%r as integerR s+ unrecognized arguments to with_sequence: %rN( t popR t intt setattrt
ValueErrorR R t keys( R t argst argt arg_rawt
arg_cooked( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/lookup/sequence.pyt
parse_kv_argsŽ s"
c C` sp t j | ƒ } | s t S| j ƒ \ } } } } } } } | d k r€ y t | d ƒ } Wq€ t k
r| t d | ƒ ‚ q€ Xn | d k rÆ y t | d ƒ } WqÆ t k
r t d | ƒ ‚ qÆ Xn | d k ry t | d ƒ } Wqt k
rt d | ƒ ‚ qXn | d k r$| | _ n | d k r<| | _ n | d k rT| | _
n | d k rl| | _ n t S( s+ parse the shortcut forms, return True/Falsei s can't parse start=%s as integers can't parse end=%s as integers can't parse stride=%s as integerN(
t SHORTCUTt matcht Falset groupsR R R R R
R
R R t True( R t termR t _R
R
R R ( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/lookup/sequence.pyt parse_simple_args¤ s8 !
c C` sO | j d k r- | j d k r- t d ƒ ‚ n | j d k rZ | j d k rZ t d ƒ ‚ nc | j d k r½ | j d k r™ | j | j | j d | _ n d | _ d | _ d | _ | ` n | j d k rí | j | j k rí t d ƒ ‚ n | j d k r| j | j k rt d ƒ ‚ n | j j d ƒ d k rKt d | j ƒ ‚ n d S( Ns* must specify count or end in with_sequences1 can't specify both count and end in with_sequencei i s' to count backwards make stride negatives+ to count forward don't make stride negativet %s bad formatting string: %s( R R R
R R
R R ( R ( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/lookup/sequence.pyt sanity_checkÇ s" ! !!c c` s› | j d k r d } n d } t | j | j | | j ƒ } xW | D]O } y | j | } | VWqD t t f k
r’ t d | | j f ƒ ‚ qD XqD Wd S( Ni i iÿÿÿÿs problem formatting %r with %r( R R R
R
R R t TypeErrorR ( R t adjustt numberst it formatted( ( sC /usr/lib/python2.7/site-packages/ansible/plugins/lookup/sequence.pyt generate_sequenceÜ s
c K` sù g } xì | D]ä } y¥ | j ƒ y) | j | ƒ sH | j t | ƒ ƒ n Wn<