Don't use template for Karaf feature config 27/57527/1
authorDaniel Farrell <dfarrell@redhat.com>
Tue, 29 Mar 2016 15:46:36 +0000 (11:46 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 19 May 2017 16:52:25 +0000 (12:52 -0400)
Templates don't work well now that ansible-opendaylight supports
installing multiple versions of ODL (via rpm_repo*, for example).

The content of the tempalted file is completly replaced, when only the
exact line that needs to be changed should be managed and the rest of
the file should use the version's default content.

Changing the version of ODL installed via params also requires changing
the default Karaf feature repos to match the version. This is confusing
and unnecessary - no one uses this knob that I know of.

Change-Id: I4cbe53b0b1f91dd01b24d2672581e1f99f2bfccb
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
README.md
tasks/configure_karaf_features.yml
templates/org.apache.karaf.features.cfg [deleted file]
vars/main.yml

index 229dea193620995404cc63e2885a894afbe3d4c3..c8b69c7da96f1b03a0b38a6e0ef7f0c82fc7058c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -23,16 +23,6 @@ They are recommended, so the ODL Ansible role defaults to installing them.
 This can be customized by overriding the `default_features` variable. You
 shouldn't normally need to do so.
 
-### Karaf Feature Repos
-
-To configure additional repos to search for Karaf features, override the
-`extra_feature_repos` variable.
-
-OpenDaylight comes with a pre-configured set of Karaf feature repos. They
-are recommended, so the ODL Ansible role defaults to installing them. This
-can be customized by overriding the `default_features` variable. You shouldn't
-normally need to do so.
-
 ### REST API Port
 
 To change the port on which OpenDaylight's northbound listens for REST API
index ad153a4f0eb307b8328d460b940fcc6d3c3139e8..9bdcb27dd03c793829f4756b9edc1d8a290e589d 100644 (file)
@@ -1,7 +1,12 @@
+- name: Build Karaf feature list
+  set_fact:
+    features: "{{ default_features + extra_features }}"
+
 - name: Configure ODL Karaf features
-  template:
-    src=org.apache.karaf.features.cfg
-    dest=/opt/opendaylight/etc/
+  lineinfile:
+    dest=/opt/opendaylight/etc/org.apache.karaf.features.cfg
+    regexp=^featuresBoot=
+    line=featuresBoot={{ features|join(',') }}
     owner=odl
     group=odl
   notify:
diff --git a/templates/org.apache.karaf.features.cfg b/templates/org.apache.karaf.features.cfg
deleted file mode 100644 (file)
index cc23a0c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-################################################################################
-#
-#    Licensed to the Apache Software Foundation (ASF) under one or more
-#    contributor license agreements.  See the NOTICE file distributed with
-#    this work for additional information regarding copyright ownership.
-#    The ASF licenses this file to You under the Apache License, Version 2.0
-#    (the "License"); you may not use this file except in compliance with
-#    the License.  You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-################################################################################
-
-#
-# Defines if the startlvl should be respected during feature startup. The default value is true. The default
-# behavior for 2.x is false (!) for this property
-#
-# Be aware that this property is deprecated and will be removed in Karaf 4.0. So, if you need to
-# set this to false, please use this only as a temporary solution!
-#
-#respectStartLvlDuringFeatureStartup=true
-
-
-#
-# Defines if the startlvl should be respected during feature uninstall. The default value is true.
-# If true, means stop bundles respecting the descend order of start level in a certain feature.
-#
-#respectStartLvlDuringFeatureUninstall=true
-
-#
-# Comma separated list of features repositories to register by default
-# Default repos:
-# mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.3.3-Lithium-SR3/xml/features
-#
-{# Feature repo list defaults are in vars/main.yml of the ODL Ansible role. #}
-{# Those are normally overridden by the role consumer, per their use-case. #}
-{% set feature_repos = default_feature_repos + extra_feature_repos %}
-featuresRepositories = {{ feature_repos|join(',') }}
-
-#
-# Comma separated list of features to install at startup
-# Default features:
-# config,standard,region,package,kar,ssh,management
-#
-{# Feature list defaults are in vars/main.yml of the ODL Ansible role. #}
-{# Those are normally overridden by the role consumer, per their use-case. #}
-{% set features = default_features + extra_features %}
-featuresBoot={{ features|join(',') }}
-
-#
-# Defines if the boot features are started in asynchronous mode (in a dedicated thread)
-#
-featuresBootAsynchronous=false
index 227b7eb06af24362da2737bd57e1ca0b5e55dfd3..7d3511b554bd12dc11f5236a50256507f1feaddd 100644 (file)
@@ -35,21 +35,6 @@ extra_features: []
 # This was added because OpenStack's Swift project uses a conflicting port.
 nb_rest_port: 8080
 
-# Karaf feature repositories configured by default in ODL's release arifact.
-# You likely don't need to override these. Override the extra_feature_repos
-# list to add custom repos to search for Karaf features.
-default_feature_repos:
-  - 'mvn:org.apache.karaf.features/standard/3.0.3/xml/features'
-  - 'mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features'
-  - 'mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features'
-  - 'mvn:org.apache.karaf.features/spring/3.0.3/xml/features'
-  - 'mvn:org.opendaylight.integration/features-integration-index/0.4.1-Beryllium-SR1/xml/features'
-
-# Karaf feature repositories to install *in addition* to the defaults repos
-# configured in the ODL release artifact. You may need to override this to
-# configure additional repos to search for Karaf features.
-extra_feature_repos: []
-
 # Method to install ODL
 # Valid options:
 #   rpm_repo: Install ODL using its Yum repo config