Comments (2)
FTR, we reached the following conclusions on IRC:
Core ideas
We'd like to make a distinction mainly between:
- packages that alter the behavior of Rex itself or add new capabilities (extensions, plugins, hooks, commands)
- packages that uses Rex to manage a specific software or service (modules, recipes)
Therefore we believe different namespaces would work best to make these distinctions clear. Having a common namespace makes it easier to find them too (e.g. by searching on CPAN or GitHub).
Examples
Extending a core namespace
Rex core is modular enough to be extended to support new functionality without having to change the core itself. A great example is the Rex::Virtualization
namespace to interact with various virtualization solutions.
This makes adding new capabilities and maintaining them easy by the community (for example Rex::Virtualization::CBSD
), and also makes great candidates to split out of core (not every user of Rex needs all the virtualization modules, and their maintenance could be decoupled from core).
Other examples include Rex::Commands
, Rex::Hook
and Rex::CMDB
namespaces. If some of those third party extensions become stable and useful enough, it is also possible to integrate them into core directly (taking future maintenance burdens and benefits into account).
Where core might not be generic enough yet for this pattern, we'd like to help community member's efforts by enabling them to integrate with Rex in a better way (e.g. by modifying core that enables better integration).
Extending Rex outside core namespaces
We believe the names "extension" and "plugin" are synonyms, and they both extend Rex core with new capabilities. If they really need a new namespace that is not present in core yet, we recommend using Rex::Plugin
.
Already used Rex::Ext
is short but doesn't seem to be clear enough, and Rex::Extension
feels too long, while both has repeating "ex" which might be hard to use in speech.
Managing software and services with Rex
When Rex is used to implement management steps for a given software (e.g. Rex::Lang::Ruby
) or service (e.g. Rex::Webserver::Apache
), we used to call that a "recipe". Rex::Recipe
looks duplicate and Rex::ipe
/Rex::Ipe
sounds fun, but not descriptive enough.
Currently we recommend using Rex::Module
namespace for those, for example Rex::Module::Apache
, Rex::Module::Ruby
.
EDIT: but also see the next comment.
Since Rex already hides the Rex
prefix for task names, this results in CLI calls like rex Module:Apache:configure
or rex Module:Ruby:setup
. If needed, the Module
prefix can also be hidden, probably upon explicit request in the code. This additional hiding behavior could even be made configurable, or a "shortest unique form" can be used for finding task names.
Using site-specific Rex modules
When the utility of a Rex module is specific to a given site (e.g. Company, Inc.), Rex::Company
namespace feels like a natural fit. This pattern still keeps it easy to optionally publish these modules for the wider community later, by simply search-and-replacing ::Company
with e.g. ::Module
.
from rex-recipes.
Currently we recommend using
Rex::Module
namespace for those, for exampleRex::Module::Apache
,Rex::Module::Ruby
. Since Rex already hides theRex
prefix for task names, this results in CLI calls likerex Module:Apache:configure
orrex Module:Ruby:setup
. If needed, theModule
prefix can also be hidden, probably upon explicit request in the code. This additional hiding behavior could even be made configurable, or a "shortest unique form" can be used for finding task names.
After playing with the Rex::Module::
prefix for a while, I think it's nice to use it as a grouping method, but it's also not mandatory in any way. While this special namespace handling may be implemented, feel free to go ahead and use e.g. Rex::Apache
for a generic-purpose Apache management module based on Rex (or keep Rex::Webserver::Apache
).
IMHO the more important thing is to fit standard CPAN naming conventions, and to avoid potentially hijacking a whole namespace if a module is only going to implement a narrow subset of a problem domain.
from rex-recipes.
Related Issues (11)
- move the recipes into a more useful namespace. HOT 2
- if we have a .rex/, then we can also cache rex-recipes per system and per user HOT 1
- What about getting stream_run into the core? HOT 3
- Rex::Webserver::nginx install task does not work. HOT 1
- Add Ruby::VersionManager support for Rex::Lang::Ruby
- Add module to easily setup and run Sparrow checks HOT 3
- problem with Rex::Lang::Java meta.yml
- Rex::Lang::Java Environment variable duplication after update java
- Document how to create and publish a Rex extension
- Republish existing recipes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rex-recipes.