Skip to content

logstash: fix first puppet run and configuration updates

  • ensure java is installed before trying to install logstash as the postinstall script is failing if not
  • add missing dependencies and notification between the logstash package, the configuration and the service
  • Restart the service in case of notification change
  • code format

As a side effect, it will install jdk11 on the production server

Related to T2787

Test Plan

diff origin/production/logstash0.internal.softwareheritage.org current/logstash0.internal.softwareheritage.org
*******************************************
+ Anchor[java::begin:]
*******************************************
+ Anchor[java::end]
*******************************************
+ Exec[update-java-alternatives] =>
   parameters =>
     "command": "update-java-alternatives --set java-1.11.0-openjdk-amd64 --jre-h...
     "path": "/usr/bin:/usr/sbin:/bin:/sbin",
     "unless": "test /etc/alternatives/java -ef '/usr/lib/jvm/java-1.11.0-openjdk...
*******************************************
  File[/etc/logstash/conf.d/filter.conf] =>
   parameters =>
     notify =>
      + Service[logstash]
*******************************************
  File[/etc/logstash/conf.d/input.conf] =>
   parameters =>
     notify =>
      + Service[logstash]
*******************************************
  File[/etc/logstash/conf.d/output.conf] =>
   parameters =>
     notify =>
      + Service[logstash]
*******************************************
+ File_line[java-home-environment] =>
   parameters =>
     "line": "JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/",
     "match": "JAVA_HOME=",
     "path": "/etc/environment"
*******************************************
+ Package[java-common] =>
   parameters =>
     "ensure": "present"
*******************************************
+ Package[java] =>
   parameters =>
     "ensure": "present",
     "name": "openjdk-11-jre-headless"
*******************************************

Migrated from D4974 (view on Phabricator)

Merge request reports