Module Assign NameStore Str Assign NameStore Str Import alias Import alias Import alias Import alias FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr NameLoad Assign NameStore Call NameLoad BinOpBitAnd AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Num With Call NameLoad NameLoad Str NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign NameStore IfExp NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore IfExp NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body If Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body With Call NameLoad NameLoad Str NameStore body If CompareEq Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr keyword NameLoad orelse Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Call AttributeLoad Str attr NameLoad If CompareNotEq NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr body Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Str With Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad keyword Call NameLoad keyword NameLoad keyword Str keyword Call NameLoad keyword Str keyword Call NameLoad keyword Str keyword Str keyword Call NameLoad keyword NameLoad keyword Str keyword Call NameLoad keyword NameLoad keyword Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str TryExcept body If NameLoad body Expr Call NameLoad NameLoad orelse Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Call NameLoad NameLoad decorator_list ImportFrom alias If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A DOCUMENTATION 
---
module: bslurp
short_description: Slurps a file from a remote node
description:
     - Used for fetching a binary blob containing the file, then push that file
       to other hosts.
options:
  src:
    description:
      - File to fetch. When dest is used, src is expected to be a str with data
    required: True
    type: str
  compress:
    description:
      - Compress file with zlib
    default: True
    type: bool
  dest:
    description:
      - Where to write out binary blob
    required: False
    type: str
  mode:
    description:
      - Destination file permissions
    default: '0644'
    type: str
  sha1:
    description:
      - sha1 hash of the underlying data
    default: None
    type: bool
author: Sam Yaple
 N/A EXAMPLES 
Distribute a file from single to many host:

- hosts: web_servers
  tasks:
    - name: Pull in web config
      bslurp: src="/path/to/file"
      register: file_data
      run_once: True
    - name: Push if changed
      bslurp:
        src: "{{ file_data.content }}"
        dest: "{{ file_data.source }}"
        mode: "{{ file_data.mode }}"
        sha1: "{{ file_data.sha1 }}"

Distribute multiple files from single to many host:

- hosts: web_servers
  tasks:
    - name: Pull in web config
      bslurp: src="{{ item }}"
      with_items:
        - "/path/to/file1"
        - "/path/to/file2"
        - "/path/to/file3"
      register: file_data
      run_once: True
    - name: Push if changed
      bslurp:
        src: "{{ item.content }}"
        dest: "{{ item.source }}"
        mode: "{{ item.mode }}"
        sha1: "{{ item.sha1 }}"
      with_items: file_data.results

Distribute a to file many host without compression; Change permissions on dest:

- hosts: web_servers
  tasks:
    - name: Pull in web config
      bslurp: src="/path/to/file"
      register: file_data
      run_once: True
    - name: Push if changed
      bslurp:
        src: "{{ file_data.content }}"
        dest: "/new/path/to/file"
        mode: "0777"
        compress: False
        sha1: "{{ file_data.sha1 }}"
 N/A base64 N/A hashlib N/A os N/A zlib copy_from_host N/A N/A module N/A N/A N/A compress N/A N/A N/A module params get compress N/A src N/A N/A N/A module params get src N/A N/A N/A N/A N/A os path exists src N/A N/A N/A N/A module fail_json msg N/A N/A file not found: {} format src N/A N/A N/A N/A os access src N/A os R_OK N/A N/A N/A N/A module fail_json msg N/A N/A file is not readable: {} format src N/A mode N/A oct N/A N/A N/A N/A os stat src st_mode 511 N/A N/A open src rb f N/A N/A raw_data N/A N/A f read N/A sha1 N/A N/A N/A N/A hashlib sha1 raw_data hexdigest N/A data N/A compress N/A N/A zlib compress raw_data raw_data N/A N/A N/A module exit_json content N/A N/A base64 b64encode data sha1 sha1 mode mode source src N/A copy_to_host N/A N/A module N/A N/A N/A compress N/A N/A N/A module params get compress N/A dest N/A N/A N/A module params get dest N/A mode N/A int N/A N/A N/A module params get mode 0 N/A sha1 N/A N/A N/A module params get sha1 N/A src N/A N/A N/A module params get src N/A data N/A N/A base64 b64decode src N/A raw_data N/A compress N/A N/A zlib decompress data data N/A sha1 N/A N/A N/A N/A N/A os path exists dest N/A N/A N/A N/A os access dest N/A os R_OK N/A N/A N/A open dest rb f N/A N/A N/A N/A N/A N/A N/A hashlib sha1 N/A N/A f read hexdigest sha1 N/A N/A N/A N/A module exit_json changed False N/A N/A N/A N/A module exit_json failed True changed False msg N/A N/A file is not accessible: {} format dest N/A N/A sha1 N/A N/A N/A N/A hashlib sha1 raw_data hexdigest N/A N/A N/A N/A module exit_json failed True changed False msg sha1 sum does not match data N/A N/A N/A os fdopen N/A N/A os open dest N/A N/A os O_WRONLY N/A os O_CREAT mode wb f N/A N/A N/A N/A f write raw_data N/A N/A N/A module exit_json changed True N/A main N/A N/A N/A N/A N/A argument_spec N/A dict compress N/A dict default True type bool dest N/A dict type str mode N/A dict default 0644 type str sha1 N/A dict default None type str src N/A dict required True type str N/A module N/A AnsibleModule argument_spec N/A dest N/A N/A N/A module params get dest N/A N/A N/A dest N/A N/A N/A copy_to_host module N/A N/A N/A copy_from_host module N/A N/A N/A Exception N/A e N/A N/A N/A N/A module exit_json failed True changed True msg N/A repr e N/A ansible.module_utils.basic * N/A N/A __name__ __main__ N/A N/A N/A main