assemble - Assembles a configuration file from fragments

Author:Stephen Fromm

Synopsis

Assembles a configuration file from fragments. Often a particular program will take a single configuration file and does not support a conf.d style structure where it is easy to build up the configuration from multiple sources. assemble will take a directory of files that can be local or have already been transferred to the system, and concatenate them together to produce a destination file. Files are assembled in string sorting order. Puppet calls this idea fragments.

Options

parameter required default choices comments
backup no no
  • yes
  • no
Create a backup file (if yes), including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
delimiter no
    A delimiter to seperate the file contents. (added in Ansible 1.4)
    dest yes
      A file to create using the concatenation of all of the source files.
      others no
        all arguments accepted by the file module also work here
        regexp no
          Assemble files only if regex matches the filename. If not set, all files are assembled. All "" (backslash) must be escaped as "\\" to comply yaml syntax. Uses Python regular expressions; see http://docs.python.org/2/library/re.html.
          remote_src no True
          • True
          • False
          If False, it will search for src at originating/master machine, if True it will go to the remote/target machine for the src. Default is True. (added in Ansible 1.4)
          src yes
            An already existing directory full of source files.

            Examples


            # Example from Ansible Playbooks
            - assemble: src=/etc/someapp/fragments dest=/etc/someapp/someapp.conf
            
            # When a delimiter is specified, it will be inserted in between each fragment
            - assemble: src=/etc/someapp/fragments dest=/etc/someapp/someapp.conf delimiter='### START FRAGMENT ###'
            

            Table Of Contents

            Previous topic

            acl - Sets and retrieves file ACL information.

            Next topic

            copy - Copies files to remote locations.