Skip to content

Autogenerate sites.php if one doesn't exist #13

@jeffgeorge

Description

@jeffgeorge

There's a slight dispute over if sites.php should be part of your repo or not.

In some cases (like a profile-based site built by Drush Make) there by definition won't be a sites.php.

Helpfully, we should be able to generate one with an erb template.

If a site's config.rb block has a multisite_dir variable set, we should check to see if /srv/www/${path}/sites/sites.php exists. If it does, we should see if there's a line in the format:

$sites['${host}'] = '${multisite_dir}';

If not, we should add one.

If no file exists, we should create a template sites.php that just starts with an open php block <?php and has that first multisite def as the first line.

This will probably be pretty difficult, as Puppet doesn't like partially modifying a file. Puppet likes managing a file outright. So if you try to modify a file twice I fully expect it would get angry . . . but then you'd need to sort out what hosts belong to what shared checkout directories, and that's not readily available due to the structure of config.rb. Maybe we need to an extra collect-to-fact like we do for hostnames?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions