ceilometer-expirer: remove the crontab during upgrade
authorEmilien Macchi <emilien@redhat.com>
Thu, 18 May 2017 20:17:41 +0000 (16:17 -0400)
committerEmilien Macchi <emilien@redhat.com>
Mon, 29 May 2017 19:28:19 +0000 (19:28 +0000)
When running disabled/ceilometer-expirer.yaml, we want to remove the
crontab that used to run ceilometer-expirer binary in periodic way.
Let's use Puppet to remove this crontab.

We can't easily use Ansible tasks this time, because the Ansible cron
module can only remove Crontabs previously managed by Ansible:
https://docs.ansible.com/ansible/cron_module.html#examples

In this case, Puppet will erase the crontab in Pike. In Queens, we'll be
able to remove these environments files since we wouldn't need it
anymore.

Change-Id: Idb050c3b281d258aea52d6a3ef40441bb9c8bcbe

puppet/services/disabled/ceilometer-expirer-disabled.yaml

index e6d8ee6..9b7b47e 100644 (file)
@@ -27,12 +27,24 @@ parameters:
                  via parameter_defaults in the resource registry.
     type: json
 
+resources:
+  CeilometerServiceBase:
+    type: ../ceilometer-base.yaml
+    properties:
+      ServiceNetMap: {get_param: ServiceNetMap}
+      DefaultPasswords: {get_param: DefaultPasswords}
+      EndpointMap: {get_param: EndpointMap}
+      RoleName: {get_param: RoleName}
+      RoleParameters: {get_param: RoleParameters}
+
 outputs:
   role_data:
-    description: Role data for the disabled Ceilometer Expirer role.
+    description: Role data for the disabling Ceilometer Expirer role.
     value:
       service_name: ceilometer_expirer_disabled
-      upgrade_tasks:
-        - name: Stop and disable ceilometer_expirer service on upgrade
-          tags: step1
-          service: name=openstack-ceilometer-expirer state=stopped enabled=no
+      config_settings:
+        map_merge:
+          - get_attr: [CeilometerServiceBase, role_data, config_settings]
+          - ceilometer::expirer::enable_cron: false
+      step_config: |
+        include ::tripleo::profile::base::ceilometer::expirer