<commit_before># <%= properties['title'] %> Installer End User Documentation

## Step By Step Installation

* Extract the `<%= properties['profile'] %>-installer-<%= version %>.tar.gz`
* Optionaly create a node definition file with the server's recipe (puppet code)
* Run the main installation script

### Extract the installer

The location of the installer is not important, you can for example extract it in the folder `/opt`

    tar xvzf <%= properties['profile'] %>-installer-<%= version %>.tar.gz

### Create a node definition file

This file is the base recipe that Puppet will use to configure the server. It's main goal is to call and setup the <%= properties['title'] %> Puppet module. You can add any Puppet code to it that will be applied to the server. It should have a `.pp` extension (e.g. `server.pp` or `name_of_my_server.pp`).

When updating the installer with a newer version, you can reuse this file. You can also use the same file on multiple servers.

Here is a simple template you can use or take inspiration from.

    # Define equivalent of $PATH environment variable in Puppet
    Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' }

    # This is a simple <%= properties['title'] %> class declaration 
<%= properties['enduser_sample_declaration'].split("\n").map do |line| "    "+line end.join("\n") %>

    # Configure a system user called 'mike' for an application developper
    user {'mike':
      ensure     => present,
      groups     => ['sigdev'],
      shell      => '/bin/bash',
      managehome => true,
    }

    ssh_authorized_key {'mikes key on his account':
      ensure  => present,
      user    => 'mike',
      type    => 'ssh-rsa',
      key     => 'AAAAB3NzaC1kc3MAAACBAPxBNSR4YKDNmE3Mob...<usually-a-long-and-boring-string>...NSR4YK',
    }

Checkout out the README.pdf file included with the installer for a complete documentation of the <%= properties['profile'] %> class and the [official Puppet documentation](https://docs.puppetlabs.com/puppet) to learn more about writing Puppet code.

### Run the installation script

This script will update Puppet if necessary and run Puppet with the good arguments. It must be run as root.

    /opt/<%= properties['profile'] %>-installer/bin/install.sh server.pp

### That's it!

That's it. If you don't see any `Error:` lines it means that Puppet successfully configured the server! (some `Warning:` lines are expected)

If you fixed mistakes in the node definition file or want to add resources for example to configure more users or manage some other configuration using Puppet, you can rerun the installation script above as many times as you want. Puppet will only apply what needs to be changed and leave the rest alone.

Have fun!

## Automatic Parameter Lookup

Puppet can automatically retrieve class parameters from Hiera. This means that you can assign values to optional class parameters not explicitly set in the declarations.

For this, you just have to create the directory in which to find hiera data and a simple data source called server.yaml to put your entries. A basic hiera configuration file is automatically created at the root of the installer as described in the [official Hiera documentation](https://docs.puppetlabs.com/hiera/1/).

## Usage with existing Puppet recipes (your own Puppetmaster server)

If you wish to use the Puppet recipes included in this installer with your Puppetmaster server, just copy all the included modules from the `modules/` onto your puppetmaster with your other modules, and create nodes as described above. If you already have modules with the same name but different code as those included with the installer, the `geomapfish` module might not work correctly.

You will also have to manage the Debian packages included yourself to make them available to the geomapfish servers.
<commit_msg>Small fixes to ENDUSER.md template<commit_after># <%= properties['title'] %> Installer End User Documentation

## Step By Step Installation

* Extract the `<%= properties['profile'] %>-installer-<%= version %>.tar.gz`
* Create a node definition file with the server's recipe (puppet code)
* Run the main installation script

### Extract the installer

The location of the installer is not important, you can for example extract it in the folder `/opt`

    tar xvzf <%= properties['profile'] %>-installer-<%= version %>.tar.gz

### Create a node definition file

This file is the base recipe that Puppet will use to configure the server. It's main goal is to call and setup the <%= properties['title'] %> Puppet module. You can add any Puppet code to it that will be applied to the server. It should have a `.pp` extension (e.g. `server.pp` or `name_of_my_server.pp`).

When updating the installer with a newer version, you can reuse this file. You can also use the same file on multiple servers.

Here is a simple template you can use or take inspiration from.

    # Define equivalent of $PATH environment variable in Puppet
    Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' }

    # This is a simple <%= properties['title'] %> class declaration 
<%= properties['enduser_sample_declaration'].split("\n").map do |line| "    "+line end.join("\n") %>

    # Configure a system user called 'mike' for an application developper
    user {'mike':
      ensure     => present,
      groups     => ['sigdev'],
      shell      => '/bin/bash',
      managehome => true,
    }

    ssh_authorized_key {'mikes key on his account':
      ensure  => present,
      user    => 'mike',
      type    => 'ssh-rsa',
      key     => 'AAAAB3NzaC1kc3MAAACBAPxBNSR4YKDNmE3Mob...<usually-a-long-and-boring-string>...NSR4YK',
    }

Checkout out the README.pdf file included with the installer for a complete documentation of the <%= properties['profile'] %> class and the [official Puppet documentation](https://docs.puppetlabs.com/puppet) to learn more about writing Puppet code.

### Run the installation script

This script will update Puppet if necessary and run Puppet with your server's definition. It must be run as root.

    /opt/<%= properties['profile'] %>-installer/bin/install.sh server.pp

### That's it!

That's it. If you don't see any `Error:` lines it means that Puppet successfully configured the server! (some `Warning:` lines are expected)

If you fixed mistakes in the node definition file or want to add resources for example to configure more users or manage some other configuration using Puppet, you can rerun the installation script above as many times as you want. Puppet will only apply what needs to be changed and leave the rest alone.

Have fun!

## Automatic Parameter Lookup

Puppet can automatically retrieve class parameters from Hiera. This means that you can assign values to optional class parameters not explicitly set in the declarations.

For this, you just have to create a directory named 'hiera' and a data source named server.yaml in it with your entries. A basic hiera configuration file is automatically created at the root of the installer as described in the [official Hiera documentation](https://docs.puppetlabs.com/hiera/1/).

## Usage with existing Puppet recipes (your own Puppetmaster server)

If you wish to use the Puppet recipes included in this installer with your Puppetmaster server, just copy all the included modules from the `modules/` onto your puppetmaster with your other modules, and create nodes as described above. If you already have modules with the same name but different code as those included with the installer, the `geomapfish` module might not work correctly.

You will also have to manage the Debian packages included yourself to make them available to the geomapfish servers.

{'fraction_non_alphanumeric': 0.08467793984768297, 'fraction_numerical': 0.001807151155285917, 'mean_word_length': 3.9571337172104926, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 43, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2610498', 'n_tokens_mistral': 2161, 'n_tokens_neox': 2036, 'n_words': 1021}