Expand my Community achievements bar.

SOLVED

OSGI configurations and bundles question.

Avatar

Level 2

I just read this articles about OSGI bundles etc.

http://adobeaemclub.com/osgi-configuration-management-aem/

Pretty well done.

But I have a more 'basic' question, what if I want to paakcge ONLY configurations parameters for given 'ootb' (Out of the box) bundles and have that easily distributable across many systems.

Ex:

I setup multiple run modes for dev.authoring, prod.authoring, dev.publishing and I want all my dev system to have the dev setup for LDAP. I haven't seen a way I can configure the bundle through CRXDE-llite and then 'create a bundle' from the ui / curls etc that I Can then package as part of all my other installations.

Admin course I took clearly explained this was a best practice but I haven't seen this in action.

Any help / pointers to sites / docs would be appreciated.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

You can create the required node structures in an AEM instance; then package it as content package using the AEM package manager, download it and upload/install it to all other environments.

Kind regards,
Jörg

View solution in original post

9 Replies

Avatar

Correct answer by
Employee Advisor

Hi,

You can create the required node structures in an AEM instance; then package it as content package using the AEM package manager, download it and upload/install it to all other environments.

Kind regards,
Jörg

Avatar

Level 2

Hi

Okay I thought I had this but I think I am missing some step so let me outline what I did (hopefully succinctly)

Idea is I want to test system level configurations and deploying them via packages. I am using the LDAP configuration bundle w/ SSO to handle authorization / authentication as my test

When I configure, by hand, in the webconsole the following bundles: 

  • Apache Jackrabbit Oak Default Sync Handler
  • Apache Jackrabbit Oak External Login Module
  • Apache Jackrabbit Oak LDAP Identity Provider
  • Adobe Granite SSO Authentication Handler

Works without a problem. I can logging and it uses corporate security and sets up groups properly etc.

Then  I wiped my instance (stopping / deleting my whole crx-quickstart folder.. to ensure it's completely fresh) and uploaded a package where I have ONLY the Default Sync Handler setup.

once the bundle is installed crxde-lite UI I have a folder /apps/system/config.author with jcrPrimaryType of sling:osgiConfig named "org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler.MS_LDAPSyncHandler".

FYI: I added the MS_LDAPSyncHandler to simulate the guuid when you do this through webconsole. All of my properties AFAIK are mapped to the correct property key seen in the OSGI bundle (ex: user.user.pathPrefix / handler.name etc etc).

However once configured the signon doesn't work, only the admin / admin login is still functional.

Remove the folder representing these settings, hand code the values in the webconsole and voila, work again.

Note: I created the package through package manager and uploaded / installed in the UI.

Any help / pointers greatly appreciated. This 'seemed' so straight forward in the course. lol

-

John

Avatar

Level 10

As you mentioned, you can create multiple runmode folders with different configurations to run on different instances. Once you have these folders, make it as a package and then distribute across others systems.

Avatar

Level 10

Keep in mind - as mentioned in that article - typically configurations on a bundle is done in the Felix web console at:

http://localhost:4502/system/console/configMgr (which i prefer)

Whether you use that - or place configuration information under /apps, what configuration you do all depends on what the bundle is. For example - if you are configuring an OSGi bundle that uses a service that contains a DataSourcePool - you use this:

[img]DataSourcePool.png[/img]

So configurations that you do depends on what the bundle does. 

Avatar

Level 8

I personally prefer to deploy all OSGI configurations via the repository. It makes environment stand up simpler and when combined with appropriate controls in GIT of SVN you get much better tracebility and audit history. 

As to you example I believe that the reason your configuration isn't being applied is that you the name of the node should be org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler-MS_LDAPSyncHandler - the important note here is the dash and not a period after DefaultSyncHandler. Individual factory configuration PIDs are denoted with a dash in the repository configurations not a period as they are depicted in Felix. 

Also shouldn't you need to configure all 4 bundles via your package just like you do manually of the configuration to work. 

As to one of your earlier questions about how to create the package you want to deploy - I typically create a Maven project to hold all my configurations and then use the content-package-maven-plugin or something similar to create the package. Then I can create the sling:osgiConfig nodes as XML and generate the package without needing a running AEM instance. I normally avoid using /apps/system as my path - that's where Felix persists change made manual in the console so I normally use /apps/platform-configs or something like that. Then I just need an XML file at the right location of my maven project that looks like:

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" propert.i.care.about="myvalue" ></jcr:root>

Avatar

Level 2

Can you elaborate what you mean by "I personally prefer to deploy all OSGI configurations via the repository.". I agree with the rest of the comment about source and such but am not sure 'how' you deploy all OSGI configs w/ the repo.

Quick comment to your last reply about all 4 bundles.. yes I should the think is I wanted to test baby steps so I left the other three manually configured and just brought in the Sync Handle via the package.

Thanks.

Avatar

Level 8

I mean deploying the configurations as sling:osgiConfig nodes in CRX rather making manual changes in the Felix web console. Maybe I should have said in the repository rather than via the repository. 

Avatar

Level 2

Okay got all this working for my loggers and such (started with a simpler implemenetation). Making changes in crxdelite / creating package. Although the maven approach is much more interesting we have issue with it in our firm.

Seem my issue originally was the naming and the primaryType of the flder I originally created.

Thanks for the help!

-

John

Avatar

Level 2

Ah okay that's how I am hoping the Packages will work.. once they are import / installed they shoud up in  CRX.. this way IC an bundle all my configs in source control, inject them to a new server via curl commands (ore once we figure out firm restrictions to the maven tools, use that instead).

hope this clarifies.

-

John