From 45fca9e0298e0499a0edff4335b2c2a3ead483ae Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 18 May 2021 15:20:07 -0600 Subject: [PATCH] Ignore puppet_config is an empty dict Previously this was required which lead to folks defining invalid empty data that actually gets ignored later in the process. Since you don't have to have a puppet_config, let's say it needs to be defined but skip validation if it is an empty. Change-Id: I7310c340a1e2b48cdbc378ab4fe3944bd7e89112 --- deployment/ceph-ansible/ceph-base.yaml | 5 +---- deployment/ceph-ansible/ceph-client.yaml | 5 +---- deployment/ceph-ansible/ceph-external.yaml | 5 +---- deployment/ceph-ansible/ceph-grafana.yaml | 5 +---- deployment/ceph-ansible/ceph-mds.yaml | 5 +---- deployment/ceph-ansible/ceph-mgr.yaml | 5 +---- deployment/ceph-ansible/ceph-mon.yaml | 5 +---- deployment/ceph-ansible/ceph-nfs.yaml | 5 +---- deployment/ceph-ansible/ceph-osd.yaml | 5 +---- deployment/ceph-ansible/ceph-rbdmirror.yaml | 5 +---- deployment/ceph-ansible/ceph-rgw.yaml | 5 +---- deployment/cephadm/ceph-base.yaml | 5 +---- deployment/cephadm/ceph-client.yaml | 5 +---- deployment/cephadm/ceph-external.yaml | 5 +---- deployment/cephadm/ceph-grafana.yaml | 5 +---- deployment/cephadm/ceph-mds.yaml | 5 +---- deployment/cephadm/ceph-mgr.yaml | 5 +---- deployment/cephadm/ceph-mon.yaml | 5 +---- deployment/cephadm/ceph-nfs.yaml | 5 +---- deployment/cephadm/ceph-osd.yaml | 5 +---- deployment/cephadm/ceph-rbdmirror.yaml | 5 +---- deployment/cephadm/ceph-rgw.yaml | 5 +---- deployment/logging/rsyslog-baremetal-ansible.yaml | 5 +---- deployment/octavia/octavia-deployment-config.j2.yaml | 5 +---- deployment/ovn/ovn-dbs-container-puppet.yaml | 6 +----- deployment/undercloud/undercloud-upgrade.yaml | 5 +---- tools/yaml-validate.py | 3 ++- 27 files changed, 28 insertions(+), 106 deletions(-) diff --git a/deployment/ceph-ansible/ceph-base.yaml b/deployment/ceph-ansible/ceph-base.yaml index e50cdc2b0b..1a4d78b607 100644 --- a/deployment/ceph-ansible/ceph-base.yaml +++ b/deployment/ceph-ansible/ceph-base.yaml @@ -538,10 +538,7 @@ outputs: value: service_name: ceph_base upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} config_settings: {} external_deploy_tasks: diff --git a/deployment/ceph-ansible/ceph-client.yaml b/deployment/ceph-ansible/ceph-client.yaml index 3eb723cb5f..dcb4807331 100644 --- a/deployment/ceph-ansible/ceph-client.yaml +++ b/deployment/ceph-ansible/ceph-client.yaml @@ -44,10 +44,7 @@ outputs: value: service_name: ceph_client upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/ceph-ansible/ceph-external.yaml b/deployment/ceph-ansible/ceph-external.yaml index 15ea179992..3a334a819d 100644 --- a/deployment/ceph-ansible/ceph-external.yaml +++ b/deployment/ceph-ansible/ceph-external.yaml @@ -48,10 +48,7 @@ outputs: value: service_name: ceph_client upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} config_settings: {} external_deploy_tasks: diff --git a/deployment/ceph-ansible/ceph-grafana.yaml b/deployment/ceph-ansible/ceph-grafana.yaml index 668529d4b0..76a3504235 100644 --- a/deployment/ceph-ansible/ceph-grafana.yaml +++ b/deployment/ceph-ansible/ceph-grafana.yaml @@ -116,10 +116,7 @@ outputs: - 9100 - 9283 upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/ceph-ansible/ceph-mds.yaml b/deployment/ceph-ansible/ceph-mds.yaml index 30cd7f66c6..3f7f9a474e 100644 --- a/deployment/ceph-ansible/ceph-mds.yaml +++ b/deployment/ceph-ansible/ceph-mds.yaml @@ -58,10 +58,7 @@ outputs: - [] upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} post_upgrade_tasks: {get_attr: [CephBase, role_data, post_upgrade_tasks]} - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/ceph-ansible/ceph-mgr.yaml b/deployment/ceph-ansible/ceph-mgr.yaml index e6fe7f9daa..8f5f00e6c8 100644 --- a/deployment/ceph-ansible/ceph-mgr.yaml +++ b/deployment/ceph-ansible/ceph-mgr.yaml @@ -109,10 +109,7 @@ outputs: - {get_param: CephEnableDashboard} - - {get_param: CephDashboardPort} upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/ceph-ansible/ceph-mon.yaml b/deployment/ceph-ansible/ceph-mon.yaml index 50e1f1cc5a..c590526571 100644 --- a/deployment/ceph-ansible/ceph-mon.yaml +++ b/deployment/ceph-ansible/ceph-mon.yaml @@ -80,10 +80,7 @@ outputs: collectd::plugin::ceph::daemons: [] upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} post_upgrade_tasks: {get_attr: [CephBase, role_data, post_upgrade_tasks]} - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/ceph-ansible/ceph-nfs.yaml b/deployment/ceph-ansible/ceph-nfs.yaml index ffc6f5dde2..a9056ae53f 100644 --- a/deployment/ceph-ansible/ceph-nfs.yaml +++ b/deployment/ceph-ansible/ceph-nfs.yaml @@ -95,10 +95,7 @@ outputs: tripleo_upgrade_key: ceph_nfs_short_node_names_override when: ceph_nfs_short_node_names_upgraded | length == ceph_nfs_short_node_names | length step_config: 'include tripleo::profile::pacemaker::ceph_nfs' - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} # step_config seems to be ignored if docker_config is present #docker_config: {} external_deploy_tasks: diff --git a/deployment/ceph-ansible/ceph-osd.yaml b/deployment/ceph-ansible/ceph-osd.yaml index 949b8dc59c..55834cbecb 100644 --- a/deployment/ceph-ansible/ceph-osd.yaml +++ b/deployment/ceph-ansible/ceph-osd.yaml @@ -114,10 +114,7 @@ outputs: when: step|int == 2 become: true delegate_to: "{{ ceph_mon_short_bootstrap_node_name }}" - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/ceph-ansible/ceph-rbdmirror.yaml b/deployment/ceph-ansible/ceph-rbdmirror.yaml index 0db41664e3..05c2c85f84 100644 --- a/deployment/ceph-ansible/ceph-rbdmirror.yaml +++ b/deployment/ceph-ansible/ceph-rbdmirror.yaml @@ -71,10 +71,7 @@ outputs: dport: - '6800-7300' upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/ceph-ansible/ceph-rgw.yaml b/deployment/ceph-ansible/ceph-rgw.yaml index 5186d055d0..ae8975861c 100644 --- a/deployment/ceph-ansible/ceph-rgw.yaml +++ b/deployment/ceph-ansible/ceph-rgw.yaml @@ -110,10 +110,7 @@ outputs: - swiftoperator upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} post_upgrade_tasks: {get_attr: [CephBase, role_data, post_upgrade_tasks]} - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/cephadm/ceph-base.yaml b/deployment/cephadm/ceph-base.yaml index 2045c0f5cc..086e2b987d 100644 --- a/deployment/cephadm/ceph-base.yaml +++ b/deployment/cephadm/ceph-base.yaml @@ -493,10 +493,7 @@ outputs: value: service_name: ceph_base upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} config_settings: {} external_deploy_tasks: diff --git a/deployment/cephadm/ceph-client.yaml b/deployment/cephadm/ceph-client.yaml index 13563d66cb..4d8e1deb2c 100644 --- a/deployment/cephadm/ceph-client.yaml +++ b/deployment/cephadm/ceph-client.yaml @@ -85,10 +85,7 @@ outputs: value: service_name: ceph_client upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/cephadm/ceph-external.yaml b/deployment/cephadm/ceph-external.yaml index 541e072d4f..615bc7c19e 100644 --- a/deployment/cephadm/ceph-external.yaml +++ b/deployment/cephadm/ceph-external.yaml @@ -52,10 +52,7 @@ outputs: value: service_name: ceph_client upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} config_settings: {} external_deploy_tasks: diff --git a/deployment/cephadm/ceph-grafana.yaml b/deployment/cephadm/ceph-grafana.yaml index 5c1905426b..65546e0245 100644 --- a/deployment/cephadm/ceph-grafana.yaml +++ b/deployment/cephadm/ceph-grafana.yaml @@ -136,10 +136,7 @@ outputs: - 9100 - 9283 upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/cephadm/ceph-mds.yaml b/deployment/cephadm/ceph-mds.yaml index 3283919147..b3e120579a 100644 --- a/deployment/cephadm/ceph-mds.yaml +++ b/deployment/cephadm/ceph-mds.yaml @@ -48,10 +48,7 @@ outputs: - if: - {get_param: CephEnableDashboard} - - '9100' - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: [] external_update_tasks: [] diff --git a/deployment/cephadm/ceph-mgr.yaml b/deployment/cephadm/ceph-mgr.yaml index 38f2a8b024..7ca1ee3924 100644 --- a/deployment/cephadm/ceph-mgr.yaml +++ b/deployment/cephadm/ceph-mgr.yaml @@ -113,10 +113,7 @@ outputs: - {get_param: CephEnableDashboard} - - {get_param: CephDashboardPort} upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/cephadm/ceph-mon.yaml b/deployment/cephadm/ceph-mon.yaml index dc9f30501e..52f7e8c56a 100644 --- a/deployment/cephadm/ceph-mon.yaml +++ b/deployment/cephadm/ceph-mon.yaml @@ -77,9 +77,6 @@ outputs: - ceph collectd::plugin::ceph::daemons: [] upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: [] diff --git a/deployment/cephadm/ceph-nfs.yaml b/deployment/cephadm/ceph-nfs.yaml index 9188bb5622..4ad83bd699 100644 --- a/deployment/cephadm/ceph-nfs.yaml +++ b/deployment/cephadm/ceph-nfs.yaml @@ -99,10 +99,7 @@ outputs: tripleo_upgrade_key: ceph_nfs_short_node_names_override when: ceph_nfs_short_node_names_upgraded | length == ceph_nfs_short_node_names | length step_config: 'include tripleo::profile::pacemaker::ceph_nfs' - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} # step_config seems to be ignored if docker_config is present #docker_config: {} external_deploy_tasks: diff --git a/deployment/cephadm/ceph-osd.yaml b/deployment/cephadm/ceph-osd.yaml index b87a7228a2..91bc9a90e6 100644 --- a/deployment/cephadm/ceph-osd.yaml +++ b/deployment/cephadm/ceph-osd.yaml @@ -103,10 +103,7 @@ outputs: tripleo.collectd.plugins.ceph_osd: - ceph collectd::plugin::ceph::daemons: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/cephadm/ceph-rbdmirror.yaml b/deployment/cephadm/ceph-rbdmirror.yaml index f8b108d1be..5aebeec53e 100644 --- a/deployment/cephadm/ceph-rbdmirror.yaml +++ b/deployment/cephadm/ceph-rbdmirror.yaml @@ -64,9 +64,6 @@ outputs: dport: - '6800-7300' upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: [] diff --git a/deployment/cephadm/ceph-rgw.yaml b/deployment/cephadm/ceph-rgw.yaml index b8def0dea1..dc3621f09f 100644 --- a/deployment/cephadm/ceph-rgw.yaml +++ b/deployment/cephadm/ceph-rgw.yaml @@ -121,10 +121,7 @@ outputs: - swiftoperator upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} post_upgrade_tasks: {get_attr: [CephBase, role_data, post_upgrade_tasks]} - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} external_deploy_tasks: list_concat: diff --git a/deployment/logging/rsyslog-baremetal-ansible.yaml b/deployment/logging/rsyslog-baremetal-ansible.yaml index 1bad3b88ca..4f374d1e04 100644 --- a/deployment/logging/rsyslog-baremetal-ansible.yaml +++ b/deployment/logging/rsyslog-baremetal-ansible.yaml @@ -37,10 +37,7 @@ outputs: deploy_steps_tasks: [] docker_config: {} kolla_config: {} - puppet_config: - config_volume: '' - step_config: '' - config_image: '' + puppet_config: {} host_prep_tasks: - name: Ensure rsyslog is installed package: diff --git a/deployment/octavia/octavia-deployment-config.j2.yaml b/deployment/octavia/octavia-deployment-config.j2.yaml index b4ca6b782e..25ec6b62a5 100644 --- a/deployment/octavia/octavia-deployment-config.j2.yaml +++ b/deployment/octavia/octavia-deployment-config.j2.yaml @@ -214,10 +214,7 @@ outputs: value: service_name: octavia_deployment_config upgrade_tasks: [] - puppet_config: - config_image: '' - config_volume: '' - step_config: '' + puppet_config: {} docker_config: {} config_settings: {} external_post_deploy_tasks: diff --git a/deployment/ovn/ovn-dbs-container-puppet.yaml b/deployment/ovn/ovn-dbs-container-puppet.yaml index ae4a3138a2..af70a48427 100644 --- a/deployment/ovn/ovn-dbs-container-puppet.yaml +++ b/deployment/ovn/ovn-dbs-container-puppet.yaml @@ -99,11 +99,7 @@ outputs: # the NB and SB DB servers to listen on the proper IP address/port # in the docker_config section. # puppet_config is defined to satisfy the pep8 validations. - puppet_config: - config_volume: '' - config_image: '' - step_config: | - include tripleo::profile::base::neutron::ovn_northd #unused + puppet_config: {} kolla_config: /var/lib/kolla/config_files/ovn_north_db_server.json: command: /usr/local/bin/start-nb-db-server diff --git a/deployment/undercloud/undercloud-upgrade.yaml b/deployment/undercloud/undercloud-upgrade.yaml index f55acf2609..f9bad36887 100644 --- a/deployment/undercloud/undercloud-upgrade.yaml +++ b/deployment/undercloud/undercloud-upgrade.yaml @@ -50,10 +50,7 @@ outputs: deploy_steps_tasks: [] docker_config: {} kolla_config: {} - puppet_config: - config_volume: '' - step_config: '' - config_image: '' + puppet_config: {} upgrade_tasks: - name: Enforce RHOSP rules regarding subscription. include_role: diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index f0cf372319..5bcd774049 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -759,7 +759,8 @@ def validate_docker_service(filename, tpl): return 1 if 'puppet_config' in role_data and \ - VALIDATE_DOCKER_PUPPET_CONFIG_OVERRIDE.get(filename, True): + VALIDATE_DOCKER_PUPPET_CONFIG_OVERRIDE.get(filename, True) and \ + role_data.get('puppet_config', {}) != {}: if validate_docker_service_mysql_usage(filename, tpl): print('ERROR: could not validate use of mysql service for %s.' % filename)