What Could We Expect from Upcoming LDAPCon 2017?

The LDAPCon is an international conference on LDAP technology and the issues such as identity management, authentication and empowerment.

LDAPCon is a biennial event and this year it will take place from 19 to 20 October in iconic city of Brussels, the capital of Belgium, where the business of the European Union and NATO is run. In the past, LDAPCon has been held in other interesting places such as the following:

At Savoir-faire Linux, we have a team of motivated developers who are committed to LDAP community. We have sponsored this conference once in 2015 (please read the news here), and have already renewed our commitment by being their Silver Sponsor for this year as well.

Maybe Small, but a Mighty Gathering

2017 LDAPConf brings together 19 presentations and workshops within its 2-day program. Our engineer, Clément OUDOT is among the steering committee. This year’s program will showcase some interesting talks such as:

  • ReOpenLDAP: Modification of OpenLDAP for intensive use by a telecommunications operator
  • OpenLDAP – a new LDAP server for Samba4: An update on the integration of OpenLDAP in Samba 4 in place of the native directory coded by the Samba team
  • PHP-LDAP: News of the evolution of the LDAP API in PHP, abandoned for several years but now the developments are resumed
  • What’s New In OpenLDAP: News from the OpenLDAP project by Howard Chu, the main developer

Other exciting LDAP topics such as Cloud Identity Management, Authorizations / Authentication, Single Sign-On or Supervision will be addressed in the various other presentations.

Savoir-faire Linux’s representative will update various SSO protocols (CAS, SAML and OpenID Connect) in a given intervention on Friday afternoon, just before the presentation of the FusionDirectory software. The data management software of an LDAP directory , used in our internal infrastructure and for some of our customers will be discussed in his presentation.

If you are interested in this conference, you can book your tickets online on the conference website.

Developing An Ansible Role for Nexus Repository Manager v3.x


This article aims to explain how to automate the installation as well as configuration of Nexus’s Repository Manager version 3.x with Ansible

Ansible is a deployment tool, which enables playbooks to automate applications and infrastructure deployments. The key advantage is its flexibility to change applications with versatility as well as apprehending them as a service. However, Ansible has some weaknesses too. Following a voluntary simple design, it functions solely as an application of parameters without taking into account information availability and security concerns, which need to be handled by other systems. That is why developers will prefer to use Ansible in combination with a stateful agent system like Puppet, or a centralized management tool like Ansible Tower.

Automation with Ansible

Ansible focuses on the application-level setup, scripting a provisioning that can be run on top of any infrastructure-supporting tool (PaaS, containers, bare-metal, vagrant, etc.). It only needs an SSH connection and a sudo account to the remote system.

Provisioning scripts in Ansible are written in a declarative style using YAML files grouped as roles. The atomic instructions in those roles are expressed using a number of core modules provided by Ansible. Please have a look at the Ansible documentation for an in-depth introduction.

Re-provisioning and Updating Configuration

One of the DevOps’ models to handle configuration updates consists of provisioning a brand new environment from scratch and completely discarding the old one (think container images). This implies a reliable management of your data lifecycle. In our particular case of Nexus’s Repository Manager, this consists of several gigs of uploaded/proxied artifacts, some audit logs, and OrientDB blobs containing the configuration. Therefore, depending on one’s environment constraints, it can make sense to be able to update the configuration of an already-provisioned Nexus instance. The declarative nature of Ansible’s core instructions is inline with this purpose, but any custom logic written in a role should be idempotent, take the “create or maybe update” path into account.

One must also note that some parts of the Nexus configuration cannot be updated. Some examples include:

  • the settings related to BlobStores
  • the admin password if you ever loose the current one (update : or maybe through this way)

How to make Nexus’s Groovy API Fit Well with Ansible

The basic steps of the installation are pretty straightforward and can all be written using simple Ansible core modules:

  • download and unpack the archive
  • create a system user/group
  • create a systemd service

(these steps are in tasks/nexus_install.yml)

And then comes the surprise: Nexus configuration is not available in a simple text file format which can be edited with the help of simple Ansible instructions. It is stored in an embedded OrientDB database that must not be altered directly. The documented way to setup Nexus is either through its web user interface, or through its Integration API.

The way the Integration API works is as follows:

  1. Write a Groovy script that handles your configuration change;
  2. Upload it to Nexus with an HTTP PUT request, creating a REST resource for this script;
  3. Call the script through its HTTP GET/POST resource.

URI Module to the Rescue!

Ansible’s uri module makes HTTP requests, providing automation to all of this.

The first step is to upload the Groovy script on Nexus. Note that the script may already be there. Therefore, on re-runs of the playbook, we try to delete it before taking any action, just in case:

Through tasks/declare_script_each.yml, follow on:

  - name: Removing (potential) previously declared Groovy script {{</span> item }}
      url: "http://localhost:8081/service/siesta/rest/v1/script/{{ item }}"
      user: 'admin'
      password: "{{ current_nexus_admin_password }}"
      method: DELETE
      force_basic_auth: yes
      status_code: 204,404

  - name: Declaring Groovy script {{ item }}
      url: "http://localhost:8081/service/siesta/rest/v1/script"
      user: 'admin'
      password: "{{ current_nexus_admin_password }}"
      body_format: json
      method: POST
      force_basic_auth: yes
      status_code: 204
        name: "{{ item }}"
        type: 'groovy'
        content: "{{ lookup('template', 'groovy/' + item + '.groovy') }}"

The HTTP requests are executed from inside the target host, which is why localhost is used here. force_basic_auth: yes makes the HTTP client not wait for a 401 before providing credentials, as Nexus immediately replies with 403 when no credentials are passed. status_code is the expected HTTP status replied by Nexus. Since the Groovy script may not necessarily exist at that point, we must also accept the 404 status code.

The next step is to call the Groovy script that has been created through the previous HTTP call. Most of the scripts will take some parameters as input (e.g. create user <x>), and this is where Ansible and Groovy will help. Both coming from the ages of REST things, they can speak and understand JSON fluently.

On the Groovy script side :

import groovy.json.JsonSlurper
parsed_args = new JsonSlurper().parseText(args)

And to call this script from Ansible passing arguments:

  - include: call_script.yml
      script_name: setup_anonymous_access
      args: # this structure will be parsed by the groovy JsonSlurper above
        anonymous_access: true

with call_script.yml:

  - name: Calling Groovy script {{ script_name }}
      url: "http://localhost:8081/service/siesta/rest/v1/script/{{ script_name }}/run"
      user: 'admin'
      password: "{{ current_nexus_admin_password }}"
        Content-Type: "text/plain"
      method: POST
      status_code: 200,204
      force_basic_auth: yes
      body: "{{ args | to_json }}"

This allows us to cleanly pass structured parameters from Ansible to the Groovy scripts, keeping the objects’ structure, arrays and basic types.

Nexus Groovy Scripts Development Tips and Tricks

Here are some hints that can help a developer while working on the Groovy scripts.

Have a Classpath Setup in Your IDE

As described in the Nexus documentation, having Nexus scripting in your IDE’s classpath can really help you work. If you automate the Nexus setup as much as possible, you will inevitably stumble against some undocumented internal APIs. Additionally, some parts of the API do not have any source available (e.g. LDAP). In such cases, a decompiler can be useful.

Since our role on Github uses Maven with the all the necessary dependencies, you can simply open it with IntelliJ and edit the scripts in files/groovy.

Scripting API Entry Points

As documented, there are four implicit entry points to access Nexus internals from your script:

  • core
  • repository
  • blobStore
  • security

Those are useful for simple operations, but for anything more complicated you will need to resolve services more in-depth:

  • through indirection from the main entry points: blobStore.getBlobStoreManager()
  • directly by resolving an inner @Singleton from container context: container.lookup(DefaultCapabilityRegistry.class.getName())

Take Examples from Nexus’s Source Code

Some parts of Nexus (7.4%, according to Github) are also written using Groovy, containing lots of nice code examples: CoreApiImpl.groovy .

Creating HTTP requests from the configuration web interface (AJAX requests) also provides some hints about the expected data structures or parameters or values of some settings.

Last but not least, setting up a remote debugger from your IDE to a live Nexus instance can help, since there are lots of places where a very generic data structure is used (like Map<String, Object>) and only runtime inspection can quickly tell the actual needed types.

Detailed Examples

Here are some commented examples of Groovy scripts taken from the Ansible role

Setting up a Capability

Capabilities are features of Nexus that can be configured using a unified user interface. In our case, this covers:

  1. anonymous access
  2. base public URL
  3. branding (custom HTML header/footer).


    import groovy.json.JsonSlurper
    import org.sonatype.nexus.capability.CapabilityReference
    import org.sonatype.nexus.capability.CapabilityType
    import org.sonatype.nexus.internal.capability.DefaultCapabilityReference
    import org.sonatype.nexus.internal.capability.DefaultCapabilityRegistry

    // unmarshall the parameters as JSON
    parsed_args = new JsonSlurper().parseText(args)

    // Type casts, JSON serialization insists on keeping those as 'boolean'
    parsed_args.capability_properties['headerEnabled'] = parsed_args.capability_properties['headerEnabled'].toString()
    parsed_args.capability_properties['footerEnabled'] = parsed_args.capability_properties['footerEnabled'].toString()

    // Resolve a @Singleton from the container context
    def capabilityRegistry = container.lookup(DefaultCapabilityRegistry.class.getName())
    def capabilityType = CapabilityType.capabilityType(parsed_args.capability_typeId)

    // Try to find an existing capability to update it
    DefaultCapabilityReference existing = capabilityRegistry.all.find {
        CapabilityReference capabilityReference -&amp;amp;amp;amp;amp;amp;amp;gt;
            capabilityReference.context().descriptor().type() == capabilityType

    // update
    if (existing) {
        log.info(parsed_args.typeId + ' capability updated to: {}',
                capabilityRegistry.update(existing.id(), existing.active, existing.notes(), parsed_args.capability_properties).toString()
    } else { // or create
        log.info(parsed_args.typeId + ' capability created as: {}', capabilityRegistry.
                add(capabilityType, true, 'configured through api', parsed_args.capability_properties).toString()

Setting up a Maven Repository Proxy

    import groovy.json.JsonSlurper
    import org.sonatype.nexus.repository.config.Configuration

    // unmarshall the parameters as JSON
    parsed_args = new JsonSlurper().parseText(args)

    // The two following data structures are good examples of things to look for via runtime inspection
    // either in client Ajax calls or breakpoints in a live server

    authentication = parsed_args.remote_username == null ? null : [
            type: 'username',
            username: parsed_args.remote_username,
            password: parsed_args.remote_password

    configuration = new Configuration(
            repositoryName: parsed_args.name,
            recipeName: 'maven2-proxy',
            online: true,
            attributes: [
                    maven  : [
                            versionPolicy: parsed_args.version_policy.toUpperCase(),
                            layoutPolicy : parsed_args.layout_policy.toUpperCase()
                    proxy  : [
                            remoteUrl: parsed_args.remote_url,
                            contentMaxAge: 1440.0,
                            metadataMaxAge: 1440.0
                    httpclient: [
                            blocked: false,
                            autoBlock: true,
                            authentication: authentication,
                            connection: [
                                    useTrustStore: false
                    storage: [
                            blobStoreName: parsed_args.blob_store,
                            strictContentTypeValidation: Boolean.valueOf(parsed_args.strict_content_validation)
                    negativeCache: [
                            enabled: true,
                            timeToLive: 1440.0

    // try to find an existing repository to update
    def existingRepository = repository.getRepositoryManager().get(parsed_args.name)

    if (existingRepository != null) {
        // repositories need to be stopped before any configuration change

        // the blobStore part cannot be updated, so we keep the existing value
        configuration.attributes['storage']['blobStoreName'] = existingRepository.configuration.attributes['storage']['blobStoreName']

        // re-enable the repo
    } else {

Setting up a Role

    import groovy.json.JsonSlurper
    import org.sonatype.nexus.security.user.UserManager
    import org.sonatype.nexus.security.role.NoSuchRoleException

    // unmarshall the parameters as JSON
    parsed_args = new JsonSlurper().parseText(args)

    // some indirect way to retrieve the service we need
    authManager = security.getSecuritySystem().getAuthorizationManager(UserManager.DEFAULT_SOURCE)

    // Try to locate an existing role to update
    def existingRole = null

    try {
        existingRole = authManager.getRole(parsed_args.id)
    } catch (NoSuchRoleException ignored) {
        // could not find role

    // Collection-type cast in groovy, here from String[] to Set&amp;amp;amp;amp;amp;amp;amp;lt;String&amp;amp;amp;amp;amp;amp;amp;gt;
    privileges = (parsed_args.privileges == null ? new HashSet() : parsed_args.privileges.toSet())
    roles = (parsed_args.roles == null ? new HashSet() : parsed_args.roles.toSet())

    if (existingRole != null) {
    } else {
        // Another collection-type cast, from Set&amp;amp;amp;amp;amp;amp;amp;lt;String&amp;amp;amp;amp;amp;amp;amp;gt; to List&amp;amp;amp;amp;amp;amp;amp;lt;String&amp;amp;amp;amp;amp;amp;amp;gt;
        security.addRole(parsed_args.id, parsed_args.name, parsed_args.description, privileges.toList(), roles.toList())

The resulting role is available at Ansible Galaxy and on Github. It features the setup of :

  • Downloading and unpacking of Nexus
  • SystemD service unit
  • (optional) SSL-enabled apache reverse proxy
  • Admin password
  • LDAP
  • Privileges and roles
  • Local users
  • Blobstores
  • All types of repos
  • Base URL
  • Branding (custom HTML header & footer)
  • Automated jobs


The Future of Open Source Software in Broadcasting Industry: SMPTE BootCamp 2017


Savoir-faire Linux participated at the Society of Motion Picture and Television Engineers (SMPTE)’s BootCamp 2017 having the overarching topic of Media in the IP Era. This bootcamp was organized by the Montreal SMPTE Committee including the main actor, CBC (Radio-Canada), and was held at LÉcole de technologie supérieure (ÉTS), June 12-13, 2017.

Michel Proulx addressing the audience at SMPTE BootCamp 2017 in Montreal

The Event’s Focus and Our Role

The SMPTE, including the Montreal/Quebec chapter, has three key goals: educating players in the media and broadcasting industry, communicating the latest technological developments, as well as encouraging networking and interaction among industry stakeholders. This year, the SMPTE’s BootCamp 2017 rallied participants around the following topics:

a) IP transport and the SMPTE 2110 Standards,
b) Virtualization and software.

On this occasion, our open source software (OSS) consultants: Éloi Bail and Amir Taherizadeh, jointly delivered a talk entitled Open Source Software: A Tool for Digital Transformation in the Broadcasting Industry. The first part revealed the empirical results of our joint R&D project with Radio-Canada on “how to handle IP contents in the cloud”. This includes deploying FFmpeg OSS technology on a general purpose server in order to transmit raw data at speed of 3.5 Gbps without relying on specialized hardware broadcasting equipment. In addition, Éloi demonstrated to the audience the actual data transmission, and performance on the stage in real time with the help of two generic servers and a switch. This showcases for the participants the technical implications and potential of FFmpeg in broadcasting industry for the years to come.

Amir Taherizadeh and Éloi Bail while presenting on the stage.

The second part explored the nature, inherent attributes, myths, advantages, challenges, and licensing opportunities associated with OSS. It explains OSS as a relevant, significant, and ubiquitous tool in a variety of industries including, but not limited to, aerospace as well as media, entertainment and broadcasting industries. The aerospace industry presents an interesting case as it is somewhat comparable to broadcasting industry on three dimensions. It is a rather closed and highly standard-governed industry. It is capital intensive and advances rapidly. There is also a complex and symbiotic interrelationship between hardware and software components. Amir presented an example where the networking stack of the Linux kernel drives the multi-media equipment of an aircraft. This case demonstrates how value-added solutions can be created having adopted an open and collaborative value creation process. Indeed, OSS projects like the Linux kernel and FFmpeg are testimonies to collaborative software development where private companies and communities work together towards a common objective.

From left to right: Éloi Bail, Daniel Guevin (Radio-Canada), David Beaulieu (Radio-Canada), Amir Taherizadeh, Ash Charles, and Francois Legrand (Radio-Canada)

Overall, we really enjoyed being part of this event as it highlighted the opportunity for software transformation – including using open source software such as FFMpeg, GStreamer – in the broadcasting industry.

Liferay DXP on Azure: A Practical Case Study

When it comes to deploying a common Java server on a common cloud infrastructure, a range of possibilities crosses one’s mind. This article presents some feedback on a particular, real-life, case of deploying Liferay Digital Experience (DXP, aka. Liferay 7 EE) on Microsoft’s Azure cloud platform.

Initial Shopping List

  • Liferay DXP, with Enterprise Subscription, fitting in the compatibility matrix
  • Process of deploying Liferay DXP on Azure
  • Reliance on SaaS solutions as much as possible
  • Use of infrastructure & platform provisioned by Ansible

The Happy Path : Azure SaaS Building Blocks

In this process, we consistently use Azure’s SaaS platform. We set up the following three (3) services:

Service I : Azure SQL database

Our team configures Tomcat JDBC using driver sqljdbc42.jar from https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774 .

Instructions :

/etc/tomcat8/Catalina/localhost/ROOT.xml :


(note : there seems to be a new MS-SQL JDBC release going on github)

Service II : Azure files

We set up the Liferay document store library using the Advanced File System Store mounted locally on Liferay’s VM. For the mounting process we use CIFS from an Azure file share.

Instructions :

/etc/fstab :

//<storage account name>.file.core.windows.net/<file share name> /var/lib/liferay/data-remote cifs vers=3.0,username=<storage account name>,password=<storage account key>,uid=tomcat8,gid=tomcat8 0 0

/var/lib/liferay/osgi/modules/com.liferay.portal.store.file.system.configuration.AdvancedFileSystemStoreConfiguration.cfg :


Service III : Azure Application Gateway

We use an Application Gateway to handle a)SSL termination ; and b)load-balancing of the web traffic between two Liferay instances (round robin only).

In order to convert the SSL certificate + chain + key to Azure’s .pfx bundle, use :

$> openssl pkcs12 -export -out <new pfx filename>.pfx -inkey <key filename>.key -in <certificate with chain filename>.crt -passout pass:<new pfx password>

The Plain Old Virtual Machine Part

Liferay DXP itself is installed on an Ubuntu Virtual Machine. This matches the recommended installation scheme for a production instance, which is deploying Liferay in the system tomcat8 installation. Liferay Hot Fixes and Service Packs can also be installed in this context, using Liferay’s patching-tool utility.

The Unexpected : Boundaries of Liferay’s Compatibility Matrix

Liferay DXP uses Elastic Search by default as its indexing and search provider. To stay within the compatibility matrix on production, Elastic Search needs to be hosted on a separate, dedicated Java Virtual Machine (JVM) (as opposed to the default development scheme which embeds ES alongside Liferay in a single JVM). Azure does not propose any Elastic Search as a service (managing your ES cluster is up to you). Furthermore, in order to secure a connection from Liferay DXP to a remote Elastic instance (e.g. Elastic cloud), you will need the extra “Liferay Elastic Shield Integration” marketplace item, purchasable as part of the Enterprise Search Add-On Subscription. This extra item would allow you to use Elastic Shield, though you cannot stay in the compatibility matrix today using Elastic Cloud, as its ES version is more recent than the one officially supported by Liferay.

Following this approach, we can install a 2.2 Elastic Search instance on a VM accessible from Liferay without having any need for Elastic Shield (on the same machine or internal network). Figure 1 below presents the summary of the global scheme explained here.

Figure 1. The Summary of the Global Scheme

Based on Figure 1 above, and the detailed explanations we can map three alternatives which can be evaluated and tested in future. First, it seems that the pre-packaged Liferay appliance allows for a single-click deployment on Azure but only for CE edition only. This is one avenue for further discovery. Second, we need to explore and evaluate the feasibility of pushing various Docker Liferay images to Azure Container Service and identify which ones do not offer this possibility. Third, is it possible to deploy Liferay as a custom Azure Web App? This is yet another issue to pursue further. For more insights on deploying Liferay Digital Experience Platform (DXP) on Microsoft’s Azure cloud platform stay tuned…