# Copyright (C) 2014, 2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, see . help: | Install a set of files onto a system To use this extension you create a directory of files you want to install onto the target system. In this example we want to copy some ssh keys onto a system % mkdir sshkeyfiles % mkdir -p sshkeyfiles/root/.ssh % cp id_rsa sshkeyfiles/root/.ssh % cp id_rsa.pub sshkeyfiles/root/.ssh Now we need to create a manifest file to set the file modes and persmissions. The manifest file should be created inside the directory that contains the files we're trying to install. cat << EOF > sshkeyfiles/manifest 0040755 0 0 /root/.ssh 0100600 0 0 /root/.ssh/id_rsa 0100644 0 0 /root/.ssh/id_rsa.pub EOF Then we add the path to our manifest to our cluster morph, this path should be relative to the system definitions repository. INSTALL_FILES: sshkeysfiles/manifest All variables starting INSTALL_FILES are considered, and are processed in alphabetical order, so if INSTALL_FILES, INSTALL_FILES_distbuild and INSTALL_FILES_openstack are given, manifests in INSTALL_FILES are processed before those in INSTALL_FILES_distbuild, followed by INSTALL_FILES_openstack. Multiple manifest files may be given in the same INSTALL_FILES variable, by providing a whitespace separated list. Shell word splitting is supported, so if a manifest's path has spaces in, the path may be shell escaped. More generally entries in the manifest are formatted as: [overwrite] NOTE: Directories on the target must be created if they do not exist. The extension supports files, symlinks and directories. For example, 0100644 0 0 /etc/issue creates a regular file at /etc/issue with 644 permissions, uid 0 and gid 0, if the file doesn't already exist. overwrite 0100644 0 0 /etc/issue creates a regular file at /etc/issue with 644 permissions, uid 0 and gid 0, if the file already exists it is overwritten. 0100755 0 0 /usr/bin/foo creates an executable file at /usr/bin/foo 0040755 0 0 /etc/foodir creates a directory with 755 permissions 0120000 0 0 /usr/bin/bar creates a symlink at /usr/bin/bar NOTE: You will still need to make a symlink in the manifest directory.