Ansible - Others
lookup
to access external file or database
Basic usage:
we can also read other data:lookup('file|env|pipe|template|ini|csvfile|dig|')
filter
filter excute commands in the management node and get responds.
Usage of filters:
different filters:
- quote
- default(n)
- default(omit)
- mandatory
- bool
- ternary
- basename
- dirname
- expanduser
- realpath
- relpath
- splitext
- b64encode
- to_uuid
- hash(‘sha1’|‘md5’|)
- checksum
- comment()
- ipaddr
- ipv4
- ipv6
- to_json
- to_yaml
Assert
Usage is just like filters
- match
- search
- version_compare
- issubset
- issuperset
- is_dir
- is_file
- is_link
- exist
assert the cmd result
- failed
- successed
- changed
- skipped