upgrades/validation: only run validation when services exist
authorEmilien Macchi <emilien@redhat.com>
Mon, 27 Feb 2017 18:04:08 +0000 (13:04 -0500)
committerEmilien Macchi <emilien@redhat.com>
Wed, 1 Mar 2017 19:49:00 +0000 (19:49 +0000)
During upgrades, validation test if a service is running before the
upgrade process starts.
In some cases, servies doesn't exist yet so we don't want to run the
validation.

This patch makes sure we check if the service is actually present on the
system before validating it's running correctly.

Also it makes sure that services are enabled before trying to stop them.
It allows use-cases where we want to add new services during an upgrade.
Also install new packages of services added in Ocata, so we can validate
upgrades on scenarios jobs.

Change-Id: Ib48fb6b1557be43956557cbde4cbe26b53a50bd8

36 files changed:
puppet/services/aodh-evaluator.yaml
puppet/services/aodh-listener.yaml
puppet/services/aodh-notifier.yaml
puppet/services/apache-internal-tls-certmonger.yaml
puppet/services/apache.yaml
puppet/services/auditd.yaml
puppet/services/barbican-api.yaml
puppet/services/ceilometer-agent-central.yaml
puppet/services/ceilometer-agent-compute.yaml
puppet/services/ceilometer-agent-notification.yaml
puppet/services/ceilometer-collector.yaml
puppet/services/ceph-rgw.yaml
puppet/services/cinder-api.yaml
puppet/services/cinder-scheduler.yaml
puppet/services/cinder-volume.yaml
puppet/services/congress.yaml
puppet/services/ec2-api.yaml
puppet/services/glance-api.yaml
puppet/services/gnocchi-metricd.yaml
puppet/services/gnocchi-statsd.yaml
puppet/services/haproxy.yaml
puppet/services/heat-api-cfn.yaml
puppet/services/heat-api-cloudwatch.yaml
puppet/services/heat-api.yaml
puppet/services/heat-engine.yaml
puppet/services/horizon.yaml
puppet/services/logging/fluentd-client.yaml
puppet/services/metrics/collectd.yaml
puppet/services/monitoring/sensu-client.yaml
puppet/services/neutron-api.yaml
puppet/services/neutron-dhcp.yaml
puppet/services/neutron-l3.yaml
puppet/services/neutron-metadata.yaml
puppet/services/neutron-ovs-agent.yaml
puppet/services/tacker.yaml
puppet/services/zaqar.yaml

index 900eb68..b8be4a9 100644 (file)
@@ -41,9 +41,16 @@ outputs:
       step_config: |
         include tripleo::profile::base::aodh::evaluator
       upgrade_tasks:
+        - name: Check if aodh_evaluator is deployed
+          command: systemctl is-enabled openstack-aodh-evaluator
+          tags: common
+          ignore_errors: True
+          register: aodh_evaluator_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-evaluator is running"
           shell: /usr/bin/systemctl show 'openstack-aodh-evaluator' --property ActiveState | grep '\bactive\b'
+          when: aodh_evaluator_enabled.rc == 0
           tags: step0,validation
         - name: Stop aodh_evaluator service
           tags: step1
+          when: aodh_evaluator_enabled.rc == 0
           service: name=openstack-aodh-evaluator state=stopped
index c5dc473..f5c9330 100644 (file)
@@ -41,9 +41,16 @@ outputs:
       step_config: |
         include tripleo::profile::base::aodh::listener
       upgrade_tasks:
+        - name: Check if aodh_listener is deployed
+          command: systemctl is-enabled openstack-aodh-listener
+          tags: common
+          ignore_errors: True
+          register: aodh_listener_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-listener is running"
           shell: /usr/bin/systemctl show 'openstack-aodh-listener' --property ActiveState | grep '\bactive\b'
+          when: aodh_listener_enabled.rc == 0
           tags: step0,validation
         - name: Stop aodh_listener service
           tags: step1
+          when: aodh_listener_enabled.rc == 0
           service: name=openstack-aodh-listener state=stopped
index 3a22575..84c50dd 100644 (file)
@@ -41,9 +41,16 @@ outputs:
       step_config: |
         include tripleo::profile::base::aodh::notifier
       upgrade_tasks:
+        - name: Check if aodh_notifier is deployed
+          command: systemctl is-enabled openstack-aodh-notifier
+          tags: common
+          ignore_errors: True
+          register: aodh_notifier_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-notifier is running"
           shell: /usr/bin/systemctl show 'openstack-aodh-notifier' --property ActiveState | grep '\bactive\b'
+          when: aodh_notifier_enabled.rc == 0
           tags: step0,validation
         - name: Stop aodh_notifier service
           tags: step1
+          when: aodh_notifier_enabled.rc == 0
           service: name=openstack-aodh-notifier state=stopped
index 4c21e02..4c94f44 100644 (file)
@@ -64,6 +64,12 @@ outputs:
           for_each:
             $NETWORK: {get_attr: [ApacheNetworks, value]}
       upgrade_tasks:
+        - name: Check if httpd is deployed
+          command: systemctl is-enabled httpd
+          tags: common
+          ignore_errors: True
+          register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check service httpd is running"
           shell: /usr/bin/systemctl show 'httpd' --property ActiveState | grep '\bactive\b'
+          when: httpd_enabled.rc == 0
           tags: step0,validation
index 74ddbde..2d95015 100644 (file)
@@ -67,6 +67,12 @@ outputs:
       metadata_settings:
         get_attr: [ApacheTLS, role_data, metadata_settings]
       upgrade_tasks:
+        - name: Check if httpd is deployed
+          command: systemctl is-enabled httpd
+          tags: common
+          ignore_errors: True
+          register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check service httpd is running"
           shell: /usr/bin/systemctl show 'httpd' --property ActiveState | grep '\bactive\b'
+          when: httpd_enabled.rc == 0
           tags: step0,validation
index a0535ae..8085ac8 100644 (file)
@@ -35,7 +35,7 @@ outputs:
       upgrade_tasks:
         - name: Check if auditd is deployed
           command: systemctl is-enabled auditd
-          tags: step0,validation
+          tags: common
           ignore_errors: True
           register: auditd_enabled
         - name: "PreUpgrade step0,validation: Check if auditd is running"
@@ -46,4 +46,5 @@ outputs:
           tags: step0,validation
         - name: Stop auditd service
           tags: step2
+          when: auditd_enabled.rc == 0
           service: name=auditd state=stopped
index ffc4c83..cba9241 100644 (file)
@@ -146,6 +146,16 @@ outputs:
       metadata_settings:
         get_attr: [ApacheServiceBase, role_data, metadata_settings]
       upgrade_tasks:
+        - name: Check if barbican_api is deployed
+          command: systemctl is-enabled openstack-barbican-api
+          tags: common
+          ignore_errors: True
+          register: barbican_api_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-barbican-api is running"
           shell: /usr/bin/systemctl show 'openstack-barbican-api' --property ActiveState | grep '\bactive\b'
+          when: barbican_api_enabled.rc == 0
           tags: step0,validation
+        - name: Install openstack-barbican-api package if it was disabled
+          tags: step3
+          yum: name=openstack-barbican-api state=latest
+          when: barbican_api_enabled.rc != 0
index e611e02..8082352 100644 (file)
@@ -56,9 +56,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::ceilometer::agent::polling
       upgrade_tasks:
+        - name: Check if ceilometer_agent_central is deployed
+          command: systemctl is-enabled openstack-ceilometer-central
+          tags: common
+          ignore_errors: True
+          register: ceilometer_agent_central_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-central is running"
           shell: /usr/bin/systemctl show 'openstack-ceilometer-central' --property ActiveState | grep '\bactive\b'
+          when: ceilometer_agent_central_enabled.rc == 0
           tags: step0,validation
         - name: Stop ceilometer_agent_central service
           tags: step1
+          when: ceilometer_agent_central_enabled.rc == 0
           service: name=openstack-ceilometer-central state=stopped
index 75c7cb3..546bcd9 100644 (file)
@@ -50,9 +50,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::ceilometer::agent::polling
       upgrade_tasks:
+        - name: Check if ceilometer_agent_compute is deployed
+          command: systemctl is-enabled openstack-ceilometer-compute
+          tags: common
+          ignore_errors: True
+          register: ceilometer_agent_compute_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-compute is running"
           shell: /usr/bin/systemctl show 'openstack-ceilometer-compute' --property ActiveState | grep '\bactive\b'
+          when: ceilometer_agent_compute_enabled.rc == 0
           tags: step0,validation
         - name: Stop ceilometer_agent_compute service
           tags: step1
+          when: ceilometer_agent_compute_enabled.rc == 0
           service: name=openstack-ceilometer-compute state=stopped
index 429fe22..4ee43f4 100644 (file)
@@ -50,9 +50,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::ceilometer::agent::notification
       upgrade_tasks:
+        - name: Check if ceilometer_agent_notification is deployed
+          command: systemctl is-enabled openstack-ceilometer-notification
+          tags: common
+          ignore_errors: True
+          register: ceilometer_agent_notification_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-notification is running"
           shell: /usr/bin/systemctl show 'openstack-ceilometer-notification' --property ActiveState | grep '\bactive\b'
+          when: ceilometer_agent_notification_enabled.rc == 0
           tags: step0,validation
         - name: Stop ceilometer_agent_notification service
           tags: step1
+          when: ceilometer_agent_notification_enabled.rc == 0
           service: name=openstack-ceilometer-notification state=stopped
index 3dc3340..b0ec971 100644 (file)
@@ -60,9 +60,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::ceilometer::collector
       upgrade_tasks:
+        - name: Check if ceilometer_collector is deployed
+          command: systemctl is-enabled openstack-ceilometer-collector
+          tags: common
+          ignore_errors: True
+          register: ceilometer_collector_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-collector is running"
           shell: /usr/bin/systemctl show 'openstack-ceilometer-collector' --property ActiveState | grep '\bactive\b'
+          when: ceilometer_collector_enabled.rc == 0
           tags: step0,validation
         - name: Stop ceilometer_collector service
           tags: step1
+          when: ceilometer_collector_enabled.rc == 0
           service: name=openstack-ceilometer-collector state=stopped
index c5b29c7..0153197 100644 (file)
@@ -79,14 +79,21 @@ outputs:
           ceph::rgw::keystone::auth::password: {get_param: SwiftPassword}
       upgrade_tasks:
         - name: Gather RGW instance ID
-          tags: step0
+          tags: common
           shell: hiera -c /etc/puppet/hiera.yaml ceph::profile::params::rgw_name radosgw.gateway
           register: rgw_id
+        - name: Check if ceph_rgw is deployed
+          command: systemctl is-enabled ceph-radosgw@{{rgw_id.stdout}}
+          tags: common
+          ignore_errors: True
+          register: ceph_rgw_enabled
         - name: Check status
           shell: /usr/bin/systemctl show ceph-radosgw@{{rgw_id.stdout}} --property ActiveState | grep '\bactive\b'
+          when: ceph_rgw_enabled.rc == 0
           tags: step0,validation
         - name: Stop RGW instance
           tags: step1
+          when: ceph_rgw_enabled.rc == 0
           service:
             name: ceph-radosgw@{{rgw_id.stdout}}
             state: stopped
index 52c4656..c0ea7aa 100644 (file)
@@ -150,8 +150,14 @@ outputs:
       metadata_settings:
         get_attr: [ApacheServiceBase, role_data, metadata_settings]
       upgrade_tasks:
+        - name: Check if cinder_api is deployed
+          command: systemctl is-enabled openstack-cinder-api
+          tags: common
+          ignore_errors: True
+          register: cinder_api_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-api is running"
           shell: /usr/bin/systemctl show 'openstack-cinder-api' --property ActiveState | grep '\bactive\b'
+          when: cinder_api_enabled.rc == 0
           tags: step0,validation
         - name: check for cinder running under apache (post upgrade)
           tags: step1
@@ -164,4 +170,5 @@ outputs:
           when: "cinder_apache.rc == 0"
         - name: Stop and disable cinder_api service (pre-upgrade not under httpd)
           tags: step1
+          when: cinder_api_enabled.rc == 0
           service: name=openstack-cinder-api state=stopped enabled=no
index 63a4f16..f8361f6 100644 (file)
@@ -52,9 +52,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::cinder::scheduler
       upgrade_tasks:
+        - name: Check if cinder_scheduler is deployed
+          command: systemctl is-enabled openstack-cinder-scheduler
+          tags: common
+          ignore_errors: True
+          register: cinder_scheduler_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-scheduler is running"
           shell: /usr/bin/systemctl show 'openstack-cinder-scheduler' --property ActiveState | grep '\bactive\b'
+          when: cinder_scheduler_enabled.rc == 0
           tags: step0,validation
         - name: Stop cinder_scheduler service
           tags: step1
+          when: cinder_scheduler_enabled.rc == 0
           service: name=openstack-cinder-scheduler state=stopped
index 74efaad..b52955e 100644 (file)
@@ -116,9 +116,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::cinder::volume
       upgrade_tasks:
+        - name: Check if cinder_volume is deployed
+          command: systemctl is-enabled openstack-cinder-volume
+          tags: common
+          ignore_errors: True
+          register: cinder_volume_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-volume is running"
           shell: /usr/bin/systemctl show 'openstack-cinder-volume' --property ActiveState | grep '\bactive\b'
+          when: cinder_volume_enabled.rc == 0
           tags: step0,validation
         - name: Stop cinder_volume service
           tags: step1
+          when: cinder_volume_enabled.rc == 0
           service: name=openstack-cinder-volume state=stopped
index a878b52..8bc9f2e 100644 (file)
@@ -97,9 +97,20 @@ outputs:
         include ::tripleo::profile::base::congress
 
       upgrade_tasks:
+        - name: Check if congress is deployed
+          command: systemctl is-enabled openstack-congress-server
+          tags: common
+          ignore_errors: True
+          register: congress_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-congress-server is running"
           shell: /usr/bin/systemctl show 'openstack-congress-server' --property ActiveState | grep '\bactive\b'
+          when: congress_enabled.rc == 0
           tags: step0,validation
         - name: Stop congress service
           tags: step1
+          when: congress_enabled.rc == 0
           service: name=openstack-congress-server state=stopped
+        - name: Install openstack-congress package if it was disabled
+          tags: step3
+          yum: name=openstack-congress state=latest
+          when: congress_enabled.rc != 0
index 090e0c4..7082139 100644 (file)
@@ -118,7 +118,7 @@ outputs:
       upgrade_tasks:
         - name: Check if ec2-api is deployed
           command: systemctl is-enabled openstack-ec2-api
-          tags: step0,validation
+          tags: common
           ignore_errors: True
           register: ec2_api_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-ec2-api is running"
@@ -129,5 +129,10 @@ outputs:
           tags: step0,validation
         - name: Stop openstack-ec2-api service
           tags: step1
+          when: ec2_api_enabled.rc == 0
           service: name=openstack-ec2-api state=stopped
+        - name: Install openstack-ec2-api package if it was disabled
+          tags: step3
+          yum: name=openstack-ec2-api state=latest
+          when: ec2_api_enabled.rc != 0
 
index 89f2ee8..ce389dc 100644 (file)
@@ -137,12 +137,26 @@ outputs:
       service_config_settings:
         get_attr: [GlanceBase, role_data, service_config_settings]
       upgrade_tasks:
+        - name: Check if glance_api is deployed
+          command: systemctl is-enabled openstack-glance-api
+          tags: common
+          ignore_errors: True
+          register: glance_api_enabled
+        #(TODO) Remove all glance-registry bits in Pike.
+        - name: Check if glance_registry is deployed
+          command: systemctl is-enabled openstack-glance-registry
+          tags: common
+          ignore_errors: True
+          register: glance_registry_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-glance-api is running"
           shell: /usr/bin/systemctl show 'openstack-glance-api' --property ActiveState | grep '\bactive\b'
           tags: step0,validation
+          when: glance_api_enabled.rc == 0
         - name: Stop glance_api service
           tags: step1
+          when: glance_api_enabled.rc == 0
           service: name=openstack-glance-api state=stopped
         - name: Stop and disable glance registry (removed for Ocata)
           tags: step1
+          when: glance_registry_enabled.rc == 0
           service: name=openstack-glance-registry state=stopped enabled=no
index 14fca13..9d76c2e 100644 (file)
@@ -47,9 +47,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::gnocchi::metricd
       upgrade_tasks:
+        - name: Check if gnocchi_metricd is deployed
+          command: systemctl is-enabled openstack-gnocchi-metricd
+          tags: common
+          ignore_errors: True
+          register: gnocchi_metricd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-metricd is running"
           shell: /usr/bin/systemctl show 'openstack-gnocchi-metricd' --property ActiveState | grep '\bactive\b'
+          when: gnocchi_metricd_enabled.rc == 0
           tags: step0,validation
         - name: Stop gnocchi_metricd service
           tags: step1
+          when: gnocchi_metricd_enabled.rc == 0
           service: name=openstack-gnocchi-metricd state=stopped
index 5f24bc5..bb8d3bc 100644 (file)
@@ -46,9 +46,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::gnocchi::statsd
       upgrade_tasks:
+        - name: Check if gnocchi_statsd is deployed
+          command: systemctl is-enabled openstack-gnocchi-statsd
+          tags: common
+          ignore_errors: True
+          register: gnocchi_statsd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-statsd is running"
           shell: /usr/bin/systemctl show 'openstack-gnocchi-statsd' --property ActiveState | grep '\bactive\b'
+          when: gnocchi_statsd_enabled.rc == 0
           tags: step0,validation
         - name: Stop gnocchi_statsd service
           tags: step1
+          when: gnocchi_statsd_enabled.rc == 0
           service: name=openstack-gnocchi-statsd state=stopped
index 7c7df34..bd5b9ef 100644 (file)
@@ -78,14 +78,22 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::haproxy
       upgrade_tasks:
+        - name: Check if haproxy is deployed
+          command: systemctl is-enabled haproxy
+          tags: common
+          ignore_errors: True
+          register: haproxy_enabled
         - name: "PreUpgrade step0,validation: Check service haproxy is running"
           shell: /usr/bin/systemctl show 'haproxy' --property ActiveState | grep '\bactive\b'
+          when: haproxy_enabled.rc == 0
           tags: step0,validation
         - name: Stop haproxy service
           tags: step2
+          when: haproxy_enabled.rc == 0
           service: name=haproxy state=stopped
         - name: Start haproxy service
           tags: step4 # Needed at step 4 for mysql
+          when: haproxy_enabled.rc == 0
           service: name=haproxy state=started
       metadata_settings:
         yaql:
index 7908baa..483f0a4 100644 (file)
@@ -85,9 +85,16 @@ outputs:
               heat::keystone::auth_cfn::password: {get_param: HeatPassword}
               heat::keystone::auth_cfn::region: {get_param: KeystoneRegion}
       upgrade_tasks:
+        - name: Check if heat_api_cfn is deployed
+          command: systemctl is-enabled openstack-heat-api-cfn
+          tags: common
+          ignore_errors: True
+          register: heat_api_cfn_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-api-cfn is running"
           shell: /usr/bin/systemctl show 'openstack-heat-api-cfn' --property ActiveState | grep '\bactive\b'
+          when: heat_api_cfn_enabled.rc == 0
           tags: step0,validation
         - name: Stop heat_api_cfn service
           tags: step1
+          when: heat_api_cfn_enabled.rc == 0
           service: name=openstack-heat-api-cfn state=stopped
index bc21fd3..8879bcb 100644 (file)
@@ -67,9 +67,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::heat::api_cloudwatch
       upgrade_tasks:
+        - name: Check if heat_api_cloudwatch is deployed
+          command: systemctl is-enabled openstack-heat-api-cloudwatch
+          tags: common
+          ignore_errors: True
+          register: heat_api_cloudwatch_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-api-cloudwatch is running"
           shell: /usr/bin/systemctl show 'openstack-heat-api-cloudwatch' --property ActiveState | grep '\bactive\b'
+          when: heat_api_cloudwatch_enabled.rc == 0
           tags: step0,validation
         - name: Stop heat_api_cloudwatch service
           tags: step1
+          when: heat_api_cloudwatch_enabled.rc == 0
           service: name=openstack-heat-api-cloudwatch state=stopped
index 7eb4739..2464011 100644 (file)
@@ -85,9 +85,16 @@ outputs:
               heat::keystone::auth::password: {get_param: HeatPassword}
               heat::keystone::auth::region: {get_param: KeystoneRegion}
       upgrade_tasks:
+        - name: Check is heat_api is deployed
+          command: systemctl is-enabled openstack-heat-api
+          tags: common
+          ignore_errors: True
+          register: heat_api_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-api is running"
           shell: /usr/bin/systemctl show 'openstack-heat-api' --property ActiveState | grep '\bactive\b'
+          when: heat_api_enabled.rc == 0
           tags: step0,validation
         - name: Stop heat_api service
           tags: step1
+          when: heat_api_enabled.rc == 0
           service: name=openstack-heat-api state=stopped
index 4197432..a166f3a 100644 (file)
@@ -137,9 +137,16 @@ outputs:
             # This is needed because the keystone profile handles creating the domain
             tripleo::profile::base::keystone::heat_admin_password: {get_param: HeatStackDomainAdminPassword}
       upgrade_tasks:
+        - name: Check if heat_engine is deployed
+          command: systemctl is-enabled openstack-heat-engine
+          tags: common
+          ignore_errors: True
+          register: heat_engine_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-engine is running"
           shell: /usr/bin/systemctl show 'openstack-heat-engine' --property ActiveState | grep '\bactive\b'
+          when: heat_engine_enabled.rc == 0
           tags: step0,validation
         - name: Stop heat_engine service
           tags: step1
+          when: heat_engine_enabled.rc == 0
           service: name=openstack-heat-engine state=stopped
index 9fa72a3..60b009a 100644 (file)
@@ -100,7 +100,7 @@ outputs:
       upgrade_tasks:
         - name: Check if httpd is deployed
           command: systemctl is-enabled httpd
-          tags: step0,validation
+          tags: common
           ignore_errors: True
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check if httpd is running"
@@ -111,4 +111,5 @@ outputs:
           tags: step0,validation
         - name: Stop Horizon (under httpd)
           tags: step1
+          when: httpd_enabled.rc == 0
           service: name=httpd state=stopped
index 490ccbe..57595b8 100644 (file)
@@ -63,11 +63,22 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::logging::fluentd
       upgrade_tasks:
+        - name: Check if fluentd_client is deployed
+          command: systemctl is-enabled fluentd
+          tags: common
+          ignore_errors: True
+          register: fluentd_client_enabled
         - name: Check status of fluentd service
           shell: >
             /usr/bin/systemctl show fluentd --property ActiveState |
             grep '\bactive\b'
+          when: fluentd_client_enabled.rc == 0
           tags: step0,validation
         - name: Stop fluentd service
           tags: step1
+          when: fluentd_client_enabled.rc == 0
           service: name=fluentd state=stopped
+        - name: Install fluentd package if it was disabled
+          tags: step3
+          yum: name=fluentd state=latest
+          when: fluentd_client_enabled.rc != 0
index da59665..49b2d4c 100644 (file)
@@ -110,11 +110,22 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::metrics::collectd
       upgrade_tasks:
+        - name: Check if collectd is deployed
+          command: systemctl is-enabled collectd
+          tags: common
+          ignore_errors: True
+          register: collectd_enabled
         - name: Check status of collectd service
           shell: >
             /usr/bin/systemctl show collectd --property ActiveState |
             grep '\bactive\b'
+          when: collectd_enabled.rc == 0
           tags: step0,validation
         - name: Stop collectd service
           tags: step1
+          when: collectd_enabled.rc == 0
           service: name=collectd state=stopped
+        - name: Install collectd package if it was disabled
+          tags: step3
+          yum: name=collectd state=latest
+          when: collectd_enabled.rc != 0
index c082654..aba2b1e 100644 (file)
@@ -63,11 +63,22 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::monitoring::sensu
       upgrade_tasks:
+        - name: Check if sensu_client is deployed
+          command: systemctl is-enabled sensu-client
+          tags: common
+          ignore_errors: True
+          register: sensu_client_enabled
         - name: Check status of sensu-client service
           shell: >
             /usr/bin/systemctl show sensu-client --property ActiveState |
             grep '\bactive\b'
+          when: sensu_client_enabled.rc == 0
           tags: step0,validation
         - name: Stop sensu-client service
           tags: step1
+          when: sensu_client_enabled.rc == 0
           service: name=sensu-client state=stopped
+        - name: Install sensu package if it was disabled
+          tags: step3
+          yum: name=sensu state=latest
+          when: sensu_client.rc != 0
index cb6317d..bb191ff 100644 (file)
@@ -189,9 +189,16 @@ outputs:
             - '%'
             - "%{hiera('mysql_bind_host')}"
       upgrade_tasks:
+        - name: Check if neutron_server is deployed
+          command: systemctl is-enabled neutron-server
+          tags: common
+          ignore_errors: True
+          register: neutron_server_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-server is running"
           shell: /usr/bin/systemctl show 'neutron-server' --property ActiveState | grep '\bactive\b'
+          when: neutron_server_enabled.rc == 0
           tags: step0,validation
         - name: Stop neutron_api service
           tags: step1
+          when: neutron_server_enabled.rc == 0
           service: name=neutron-server state=stopped
index b31933f..fe7f9f3 100644 (file)
@@ -80,9 +80,16 @@ outputs:
       step_config: |
         include tripleo::profile::base::neutron::dhcp
       upgrade_tasks:
+        - name: Check if neutron_dhcp_agent is deployed
+          command: systemctl is-enabled neutron-dhcp-agent
+          tags: common
+          ignore_errors: True
+          register: neutron_dhcp_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-dhcp-agent is running"
           shell: /usr/bin/systemctl show 'neutron-dhcp-agent' --property ActiveState | grep '\bactive\b'
+          when: neutron_dhcp_agent_enabled.rc == 0
           tags: step0,validation
         - name: Stop neutron_dhcp service
           tags: step1
+          when: neutron_dhcp_agent_enabled.rc == 0
           service: name=neutron-dhcp-agent state=stopped
index 572c89a..cd9870b 100644 (file)
@@ -85,9 +85,16 @@ outputs:
       step_config: |
         include tripleo::profile::base::neutron::l3
       upgrade_tasks:
+        - name: Check if neutron_l3_agent is deployed
+          command: systemctl is-enabled neutron-l3-agent
+          tags: common
+          ignore_errors: True
+          register: neutron_l3_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-l3-agent is running"
           shell: /usr/bin/systemctl show 'neutron-l3-agent' --property ActiveState | grep '\bactive\b'
+          when: neutron_l3_agent_enabled.rc == 0
           tags: step0,validation
         - name: Stop neutron_l3 service
           tags: step1
+          when: neutron_l3_agent_enabled.rc == 0
           service: name=neutron-l3-agent state=stopped
index f936ecd..32ef567 100644 (file)
@@ -76,9 +76,16 @@ outputs:
       step_config: |
         include tripleo::profile::base::neutron::metadata
       upgrade_tasks:
+        - name: Check if neutron_metadata_agent is deployed
+          command: systemctl is-enabled neutron-metadata-agent
+          tags: common
+          ignore_errors: True
+          register: neutron_metadata_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-metadata-agent is running"
           shell: /usr/bin/systemctl show 'neutron-metadata-agent' --property ActiveState | grep '\bactive\b'
+          when: neutron_metadata_agent_enabled.rc == 0
           tags: step0,validation
         - name: Stop neutron_metadata service
           tags: step1
+          when: neutron_metadata_agent_enabled.rc == 0
           service: name=neutron-metadata-agent state=stopped
index 25bd5b5..01471ba 100644 (file)
@@ -121,9 +121,16 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::neutron::ovs
       upgrade_tasks:
+        - name: Check if neutron_ovs_agent is deployed
+          command: systemctl is-enabled neutron-openvswitch-agent
+          tags: common
+          ignore_errors: True
+          register: neutron_ovs_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-openvswitch-agent is running"
           shell: /usr/bin/systemctl show 'neutron-openvswitch-agent' --property ActiveState | grep '\bactive\b'
+          when: neutron_ovs_agent_enabled.rc == 0
           tags: step0,validation
         - name: Stop neutron_ovs_agent service
           tags: step1
+          when: neutron_ovs_agent_enabled.rc == 0
           service: name=neutron-openvswitch-agent state=stopped
index 0a37e1d..6f92066 100644 (file)
@@ -97,9 +97,20 @@ outputs:
       step_config: |
         include ::tripleo::profile::base::tacker
       upgrade_tasks:
+        - name: Check if tacker is deployed
+          command: systemctl is-enabled openstack-tacker-server
+          tags: common
+          ignore_errors: True
+          register: tacker_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-tacker-server is running"
           shell: /usr/bin/systemctl show 'openstack-tacker-server' --property ActiveState | grep '\bactive\b'
+          when: tacker_enabled.rc == 0
           tags: step0,validation
         - name: Stop tacker service
           tags: step1
+          when: tacker_enabled.rc == 0
           service: name=openstack-tacker-server state=stopped
+        - name: Install openstack-tacker package if it was disabled
+          tags: step3
+          yum: name=openstack-tacker state=latest
+          when: tacker_enabled.rc != 0
index bc3a51c..a320f69 100644 (file)
@@ -67,7 +67,7 @@ outputs:
       upgrade_tasks:
         - name: Check if zaqar is deployed
           command: systemctl is-enabled openstack-zaqar
-          tags: step0,validation
+          tags: common
           ignore_errors: True
           register: zaqar_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-zaqar is running"
@@ -78,4 +78,9 @@ outputs:
           tags: step0,validation
         - name: Stop zaqar service
           tags: step1
+          when: zaqar_enabled.rc == 0
           service: name=openstack-zaqar state=stopped
+        - name: Install openstack-zaqar package if it was disabled
+          tags: step3
+          yum: name=openstack-zaqar state=latest
+          when: zaqar_enabled.rc != 0