Documentation

    PLEASE NOTE: This document applies to v2.18 version and not to the latest stable release v2.19

    Documentation for other releases can be found by using the version selector in the top right of any doc page.

    slurp

    This module reads a file and returns its content base64 encoded. Useful for reading files (including binary) for use in templates or registering variables.

    Attributes

    check_mode:
      support: none
    

    Parameters

    Parameter Required Type Values Description
    src true string   The file to read.

    Example

    - name: Read SSL certificate
      slurp:
        src: /etc/ssl/certs/app.crt
      register: cert_content
    
    - name: Display certificate info
      debug:
        msg: "Certificate: {{ cert_content.content | b64decode }}"
    
    - name: Read JSON config
      slurp:
        src: /etc/app/config.json
      register: config_raw