I have started a project with drupal 8 and I was wondering if there was a way to ensure that certain modules that I use for development are never exported in using config-export. I don't want these modules enabled in our production site but they are being exported in core.extension.yml. Is there any solution that would allow modules to be enabled for development only? Has anyone had this same issue, if so what was your solution?

Comments

pshafer’s picture

I looks like this is supported in in drush, http://www.drush.org/en/master/config-exporting/#ignoring-development-modules

I guess I answered my own question, hope others find this useful.

anthony.bouch’s picture

Thanks - I was just looking into this and I think this also solves my own problem - however, in my case, I would like the module to be available on both dev and production sites, but not include the module settings during an export/import cycle. The settings include an API key and a host end point which are going to be different. Unless there is another way to do this, I think your solution will work.

EDIT: This approach prevents the module from being imported/exported, but the module settings are still present in the sync. :-(

Okay it appears that configuration is a little different....

https://pantheon.io/blog/using-configuration-module-filter-drush-8
https://www.drupal.org/node/1928898

Not 100% sure yet, but it looks like I can define a configuration override in the module itself.

ssibal’s picture

Do you have any success "ignoring" settings for modules as well? Can you show us a working example?

dman’s picture

I'm wondering that also. Following the example to ignore 'devel', the module was left out of the core.extension changes OK, but I still get

n$ drush config-export
Differences of the active config to the export directory:

 Collection  Config                                            Operation                
             system.menu.devel                                 create 
             devel.settings                                    create 

And so my config directory would not only get cluttered, but (from experience) next time I try to toggle devel on again, the system is likely to start complaining about a mis-matched config already exisiting. I was considering adding these to my gitignore, but that's going down a bad path of special exceptions.
config-export with skip-modules doesn't seem to be doing the job we want it to do it it leaves (invalid) settings in the sync directory.

I looked at the help, but there doesn't seem to be a config-export --skip-setting (which would seem to be a useful option)

Any hints?