Documentation

    assemble

    Assemble configuration files from fragments.

    Attributes

    check_mode:
      support: full
    

    Parameters

    Parameter Required Type Values Description
    src true string   An already existing directory full of source files.
    dest true string   A file to create using the concatenation of all of the source files.
    delimiter   string   A delimiter to separate the file contents.
    validate   string   The validation command to run before copying into place. The path to the file to validate is passed in by %s which must be present.
    regexp   string   Assemble files only if the given regular expression matches the filename. If not set, all files are assembled.
    ignore_hidden   boolean   A boolean that controls if files that start with a . will be included or not. [default: false]
    mode   string   Permissions of the destination file.

    Examples

    - name: Assemble from fragments from a directory
      assemble:
        src: /etc/someapp/fragments
        dest: /etc/someapp/someapp.conf
    
    - name: Insert the provided delimiter between fragments
      assemble:
        src: /etc/someapp/fragments
        dest: /etc/someapp/someapp.conf
        delimiter: '### START FRAGMENT ###'
    
    - name: Assemble a new "sshd_config" file into place, after passing validation
      assemble:
        src: /etc/ssh/conf.d/
        dest: /etc/ssh/sshd_config
        validate: /usr/sbin/sshd -t -f %s