From ef76e92bb30169f8379a1963567f6bb22e49043d Mon Sep 17 00:00:00 2001 From: Zhu Sheng Li Date: Fri, 15 May 2020 12:44:45 +0800 Subject: [PATCH] Add non-string value support for CephAnsibleEnvironmentVariables CephAnsibleEnvironmentVariables data is supposed to be transformed into "KEY=VALUE" format by yaql expression. ``` ceph_ansible_environment_variables: yaql: data: {get_param: CephAnsibleEnvironmentVariables} expression: $.data.items().select($[0] + '=' + $[1]) ``` However, the expression here uses `+` to join the key($[0]) and value($[1]), which will cause syntax error when value is not string type. For example: If we use boolean or integer for environment values such as ``` parameter_defaults: CephAnsibleEnvironmentVariables: ANSIBLE_DEBUG: true ``` the following error will occour ``` overcloud.CephStorageServiceChain: resource_type: OS::TripleO::CephStorageServices physical_resource_id: 51fd6f95-027b-4047-9132-763e1cb8150c status: UPDATE_FAILED status_reason: | resources.CephStorageServiceChain: Error in 4 output role_data: Error in CephBase output role_data: No function "#operator_+" matches supplied arguments ``` Change-Id: I8394cec6bbaca9c89c848eaddf724c072bc36cb3 Closes-Bug: #1878720 --- ci/environments/scenario001-multinode-containers.yaml | 4 ++-- ci/environments/scenario001-standalone.yaml | 4 ++-- ci/environments/scenario004-standalone.yaml | 4 ++-- ci/environments/scenario010-standalone.yaml | 4 ++-- deployment/ceph-ansible/ceph-base.yaml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ci/environments/scenario001-multinode-containers.yaml b/ci/environments/scenario001-multinode-containers.yaml index d063603d6f..7ddc9d1843 100644 --- a/ci/environments/scenario001-multinode-containers.yaml +++ b/ci/environments/scenario001-multinode-containers.yaml @@ -148,8 +148,8 @@ parameter_defaults: CephClientKey: 'AQC+vYNXgDAgAhAAc8UoYt+OTz5uhV7ItLdwUw==' CephAnsiblePlaybookVerbosity: 1 CephAnsibleEnvironmentVariables: - ANSIBLE_SSH_RETRIES: '4' - DEFAULT_FORKS: '3' + ANSIBLE_SSH_RETRIES: 4 + DEFAULT_FORKS: 3 NovaEnableRbdBackend: true CinderEnableRbdBackend: true CinderRbdExtraPools: altrbd diff --git a/ci/environments/scenario001-standalone.yaml b/ci/environments/scenario001-standalone.yaml index 7c2c6639e2..676507aa49 100644 --- a/ci/environments/scenario001-standalone.yaml +++ b/ci/environments/scenario001-standalone.yaml @@ -126,8 +126,8 @@ parameter_defaults: dashboard_enabled: false CephAnsiblePlaybookVerbosity: 1 CephAnsibleEnvironmentVariables: - ANSIBLE_SSH_RETRIES: '4' - DEFAULT_FORKS: '3' + ANSIBLE_SSH_RETRIES: 4 + DEFAULT_FORKS: 3 NovaEnableRbdBackend: true CinderEnableRbdBackend: true CinderBackupBackend: ceph diff --git a/ci/environments/scenario004-standalone.yaml b/ci/environments/scenario004-standalone.yaml index bee378736e..cc059b21ac 100644 --- a/ci/environments/scenario004-standalone.yaml +++ b/ci/environments/scenario004-standalone.yaml @@ -63,8 +63,8 @@ parameter_defaults: CephAnsiblePlaybookVerbosity: 1 CephAnsibleRepo: "tripleo-centos-ceph-nautilus" CephAnsibleEnvironmentVariables: - ANSIBLE_SSH_RETRIES: '4' - DEFAULT_FORKS: '3' + ANSIBLE_SSH_RETRIES: 4 + DEFAULT_FORKS: 3 ManilaCephFSDataPoolPGNum: 16 ManilaCephFSMetadataPoolPGNum: 16 NovaEnableRbdBackend: true diff --git a/ci/environments/scenario010-standalone.yaml b/ci/environments/scenario010-standalone.yaml index 25b605566f..0a94f3676b 100644 --- a/ci/environments/scenario010-standalone.yaml +++ b/ci/environments/scenario010-standalone.yaml @@ -64,8 +64,8 @@ parameter_defaults: CephClientKey: 'AQC+vYNXgDAgAhAAc8UoYt+OTz5uhV7ItLdwUw==' CephAnsiblePlaybookVerbosity: 1 CephAnsibleEnvironmentVariables: - ANSIBLE_SSH_RETRIES: '4' - DEFAULT_FORKS: '3' + ANSIBLE_SSH_RETRIES: 4 + DEFAULT_FORKS: 3 NovaEnableRbdBackend: true CinderEnableRbdBackend: true CephAnsibleRepo: "tripleo-centos-ceph-nautilus" diff --git a/deployment/ceph-ansible/ceph-base.yaml b/deployment/ceph-ansible/ceph-base.yaml index d6f6cbe669..8d47ef18c4 100644 --- a/deployment/ceph-ansible/ceph-base.yaml +++ b/deployment/ceph-ansible/ceph-base.yaml @@ -701,7 +701,7 @@ outputs: ceph_ansible_environment_variables: yaql: data: {get_param: CephAnsibleEnvironmentVariables} - expression: $.data.items().select($[0] + '=' + $[1]) + expression: $.data.items().select($.join('=')) ceph_ansible_skip_tags: {get_param: CephAnsibleSkipTags} - name: get ssh private key include_role: