I'm creating a user Role in a .yml file like user.role.myrole.yml
.
This works fine when this module is installed manually and the Role is created.
When I enable this module via configuration import though, only the roles defined in this configuration set are installed and not what is in the config/install folder of that module.
Tried putting that file in config/optional folder and writing a hook_install() for the user creation also with the same results.
I would like to have this only in the module, the module may or not be installed via config, so I need this role only when this module is enabled. How can this be achieved?
Thank you