??????????????
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 Z d d l
Z
d d l m Z m
Z
d d l m Z d d l m Z d d l m Z m Z m Z d d
l m Z d d d „ ƒ YZ d
d d „ ƒ YZ d e f d „ ƒ YZ d S( i ( t absolute_importt divisiont print_functions`
lookup: csvfile
author: Jan-Piet Mens (@jpmens)
version_added: "1.5"
short_description: read data from a TSV or CSV file
description:
- The csvfile lookup reads the contents of a file in CSV (comma-separated value) format.
The lookup looks for the row where the first column matches keyname, and returns the value in the second column, unless a different column is specified.
options:
col:
description: column to return (0 index).
default: "1"
default:
description: what to return if the value is not found in the file.
default: ''
delimiter:
description: field separator in the file, for a tab you can specify "TAB" or "t".
default: TAB
file:
description: name of the CSV/TSV file to open.
default: ansible.csv
encoding:
description: Encoding (character set) of the used CSV file.
default: utf-8
version_added: "2.1"
notes:
- The default is for TSV files (tab delimited) not CSV (comma delimited) ... yes the name is misleading.
s·
- name: Match 'Li' on the first column, return the second column (0 based index)
debug: msg="The atomic number of Lithium is {{ lookup('csvfile', 'Li file=elements.csv delimiter=,') }}"
- name: msg="Match 'Li' on the first column, but return the 3rd column (columns start counting after the match)"
debug: msg="The atomic mass of Lithium is {{ lookup('csvfile', 'Li file=elements.csv delimiter=, col=2') }}"
- name: Define Values From CSV File
set_fact:
loop_ip: "{{ lookup('csvfile', bgp_neighbor_ip +' file=bgp_neighbors.csv delimiter=, col=1') }}"
int_ip: "{{ lookup('csvfile', bgp_neighbor_ip +' file=bgp_neighbors.csv delimiter=, col=2') }}"
int_mask: "{{ lookup('csvfile', bgp_neighbor_ip +' file=bgp_neighbors.csv delimiter=, col=3') }}"
int_name: "{{ lookup('csvfile', bgp_neighbor_ip +' file=bgp_neighbors.csv delimiter=, col=4') }}"
local_as: "{{ lookup('csvfile', bgp_neighbor_ip +' file=bgp_neighbors.csv delimiter=, col=5') }}"
neighbor_as: "{{ lookup('csvfile', bgp_neighbor_ip +' file=bgp_neighbors.csv delimiter=, col=6') }}"
neigh_int_ip: "{{ lookup('csvfile', bgp_neighbor_ip +' file=bgp_neighbors.csv delimiter=, col=7') }}"
delegate_to: localhost
sA
_raw:
description:
- value(s) stored in file column
N( t AnsibleErrort AnsibleAssertionError( t
LookupBase( t PY2( t to_bytest to_nativet to_text( t MutableSequencet
CSVRecoderc B` s2 e Z d Z d d „ Z d „ Z d „ Z e Z RS( sP
Iterator that reads an encoded stream and reencodes the input to UTF-8
s utf-8c C` s t j | ƒ | ƒ | _ d S( N( t codecst getreadert reader( t selft ft encoding( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyt __init__K s c C` s | S( N( ( R ( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyt __iter__N s c C` s t | j ƒ j d ƒ S( Ns utf-8( t nextR t encode( R ( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyt __next__Q s ( t __name__t
__module__t __doc__R R R R ( ( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyR G s
t CSVReaderc B` s8 e Z d Z e j d d „ Z d „ Z e Z d „ Z RS( su
A CSV reader which will iterate over lines in the CSV file "f",
which is encoded in the given encoding.
s utf-8c K` sL t r t | | ƒ } n t j | ƒ | ƒ } t j | d | | | _ d S( Nt dialect( R R R R
t csvR ( R R R R t kwds( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyR ] s c C` s, t | j ƒ } g | D] } t | ƒ ^ q S( N( R R R ( R t rowt s( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyR e s c C` s | S( N( ( R ( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyR k s ( R R R R t excelR R R R ( ( ( sB /usr/lib/python2.7/site-packages/ansible/plugins/lookup/csvfile.pyR W s
t LookupModulec B` s&