Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge "Convert container environment from a list to a dict"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Oct 17, 2019
2 parents 8426113 + 81258ae commit bf60423
Show file tree
Hide file tree
Showing 105 changed files with 327 additions and 431 deletions.
5 changes: 3 additions & 2 deletions common/container-puppet.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,10 @@ def mp_puppet_config(*args):
config_hashes = filter(None, config_hashes)
config_hash = '-'.join(config_hashes)
if config_hash:
env = v.get('environment', [])
env.append("TRIPLEO_CONFIG_HASH=%s" % config_hash)
log.debug("Updating config hash for %s, config_volume=%s hash=%s" % (k, config_volume, config_hash))
# When python 27 support is removed, we will be able to use z = {**x, **y} to merge the dicts.
v.get('environment', {}).update({'TRIPLEO_CONFIG_HASH': config_hash})
env = v.get('environment')
infile_data[k]['environment'] = env

outfile = os.path.join(os.path.dirname(infile), "hashed-" + os.path.basename(infile))
Expand Down
2 changes: 1 addition & 1 deletion deployment/aodh/aodh-api-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ outputs:
- /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
- ''
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent logs directory
file:
Expand Down
2 changes: 1 addition & 1 deletion deployment/aodh/aodh-evaluator-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ outputs:
- /var/lib/config-data/puppet-generated/aodh/:/var/lib/kolla/config_files/src:ro
- /var/log/containers/aodh:/var/log/aodh:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
2 changes: 1 addition & 1 deletion deployment/aodh/aodh-listener-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ outputs:
- /var/lib/config-data/puppet-generated/aodh/:/var/lib/kolla/config_files/src:ro
- /var/log/containers/aodh:/var/log/aodh:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
2 changes: 1 addition & 1 deletion deployment/aodh/aodh-notifier-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ outputs:
- /var/lib/config-data/puppet-generated/aodh/:/var/lib/kolla/config_files/src:ro
- /var/log/containers/aodh:/var/log/aodh:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
31 changes: 6 additions & 25 deletions deployment/barbican/barbican-api-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,7 @@ outputs:
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
command:
list_join:
- ' '
Expand Down Expand Up @@ -515,10 +512,7 @@ outputs:
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
command:
list_join:
- ' '
Expand Down Expand Up @@ -558,12 +552,7 @@ outputs:
user: root
volumes: *barbican_api_volumes
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
command: "/usr/bin/bootstrap_host_exec barbican_api /opt/nfast/bin/rfs-sync --commit"
- {}
- if:
Expand All @@ -576,12 +565,7 @@ outputs:
user: root
volumes: *barbican_api_volumes
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
command: "/opt/nfast/bin/rfs-sync --update"
- {}
- barbican_api_db_sync:
Expand Down Expand Up @@ -630,10 +614,7 @@ outputs:
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
command:
list_join:
- ' '
Expand Down Expand Up @@ -681,7 +662,7 @@ outputs:
- /usr/lib64/libnethsm.so:/usr/lib64/libnethsm.so
- null
environment: &kolla_env
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
- barbican_keystone_listener:
start_order: 6
image: {get_param: ContainerBarbicanKeystoneListenerImage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ outputs:
- /dev:/dev
- /run:/run
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
post_upgrade_tasks:
- when: step|int == 1
import_role:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ outputs:
- /var/lib/config-data/puppet-generated/ceilometer/:/var/lib/kolla/config_files/src:ro
- /var/log/containers/ceilometer:/var/log/ceilometer:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
step_5:
ceilometer_gnocchi_upgrade:
start_order: 99
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ outputs:
- /var/run/libvirt:/var/run/libvirt:ro
- /var/log/containers/ceilometer:/var/log/ceilometer:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ outputs:
- /var/lib/kolla/config_files/ceilometer-agent-ipmi.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/ceilometer/:/var/lib/kolla/config_files/src:ro
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ outputs:
- /var/lib/config-data/puppet-generated/ceilometer/:/var/lib/kolla/config_files/src:ro
- /var/log/containers/ceilometer:/var/log/ceilometer:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
4 changes: 2 additions & 2 deletions deployment/cinder/cinder-api-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ outputs:
- /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
- ''
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
cinder_api_cron:
image: *cinder_api_image
net: host
Expand All @@ -319,7 +319,7 @@ outputs:
- /var/log/containers/cinder:/var/log/cinder:z
- /var/log/containers/httpd/cinder-api:/var/log/httpd:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
container_puppet_tasks:
# Create the default volume type after the cinder-api service is
# running. The puppet code will ensure this is only done once, on
Expand Down
7 changes: 2 additions & 5 deletions deployment/cinder/cinder-backup-pacemaker-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ outputs:
ipc: host
user: root
environment:
- TRIPLEO_MINOR_UPDATE
TRIPLEO_MINOR_UPDATE: ''
command: /pacemaker_restart_bundle.sh openstack-cinder-backup cinder_backup
image: {get_param: ContainerCinderBackupImage}
volumes:
Expand Down Expand Up @@ -213,10 +213,7 @@ outputs:
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
host_prep_tasks: {get_attr: [CinderCommon, cinder_backup_host_prep_tasks]}
deploy_steps_tasks:
- name: Cinder Backup tag container image for pacemaker
Expand Down
13 changes: 6 additions & 7 deletions deployment/cinder/cinder-common-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ parameters:
description: list of optional volumes to be mounted
type: comma_delimited_list
CinderVolumeOptEnvVars:
default: []
description: list of optional environment variables
type: comma_delimited_list
default: {}
description: hash of optional environment variables
type: json
CinderEnableIscsiBackend:
default: true
description: Whether to enable or not the Iscsi backend for Cinder
Expand Down Expand Up @@ -178,10 +178,9 @@ outputs:
cinder_volume_environment:
description: Docker environment for the cinder-volume container (HA or non-HA)
value:
list_concat:
map_merge:
- {get_param: CinderVolumeOptEnvVars}
-
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
- KOLLA_CONFIG_STRATEGY: COPY_ALWAYS

cinder_backup_host_prep_tasks:
description: Host prep tasks for the cinder-backup service (HA or non-HA)
Expand Down Expand Up @@ -213,4 +212,4 @@ outputs:
cinder_backup_environment:
description: Docker environment for the cinder-backup container (HA or non-HA)
value:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
2 changes: 1 addition & 1 deletion deployment/cinder/cinder-scheduler-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ outputs:
- /var/lib/config-data/puppet-generated/cinder/:/var/lib/kolla/config_files/src:ro
- /var/log/containers/cinder:/var/log/cinder:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
7 changes: 2 additions & 5 deletions deployment/cinder/cinder-volume-pacemaker-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ outputs:
ipc: host
user: root
environment:
- TRIPLEO_MINOR_UPDATE
TRIPLEO_MINOR_UPDATE: ''
command: /pacemaker_restart_bundle.sh openstack-cinder-volume cinder_volume
image: {get_param: ContainerCinderVolumeImage}
volumes:
Expand Down Expand Up @@ -198,10 +198,7 @@ outputs:
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
host_prep_tasks: {get_attr: [CinderCommon, cinder_volume_host_prep_tasks]}
deploy_steps_tasks:
- name: Cinder Volume tag container image for pacemaker
Expand Down
28 changes: 12 additions & 16 deletions deployment/database/mysql-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,16 @@ outputs:
- /etc/pki/tls/private/mysql.key:/var/lib/kolla/config_files/src-tls/etc/pki/tls/private/mysql.key:ro
- null
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
- KOLLA_BOOTSTRAP=True
- DB_MAX_TIMEOUT=60
-
list_join:
- '='
- - 'DB_ROOT_PASSWORD'
-
yaql:
expression: $.data.passwords.where($ != '').first()
data:
passwords:
- {get_param: MysqlRootPassword}
- {get_param: [DefaultPasswords, mysql_root_password]}
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
KOLLA_BOOTSTRAP: true
DB_MAX_TIMEOUT: 60
DB_ROOT_PASSWORD:
yaql:
expression: $.data.passwords.where($ != '').first()
data:
passwords:
- {get_param: MysqlRootPassword}
- {get_param: [DefaultPasswords, mysql_root_password]}
mysql:
start_order: 2
stop_grace_period: 60
Expand All @@ -199,7 +195,7 @@ outputs:
test: /openstack/healthcheck
volumes: *mysql_volumes
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
step_3:
# sync credentials config on the running container if it was
# changed by the docker_puppet_task during step 2
Expand All @@ -211,7 +207,7 @@ outputs:
command:
[ 'mysql', '/bin/bash', '-c', 'cp /var/lib/kolla/config_files/src/root/.my.cnf /root' ]
environment:
- KOLLA_BOOTSTRAP=True
KOLLA_BOOTSTRAP: true
container_puppet_tasks:
# MySQL database initialization occurs only on single node
step_2:
Expand Down
37 changes: 13 additions & 24 deletions deployment/database/mysql-pacemaker-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,25 +237,17 @@ outputs:
- /var/lib/config-data/puppet-generated/mysql/:/var/lib/kolla/config_files/src:ro
- /var/lib/mysql:/var/lib/mysql
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
- KOLLA_BOOTSTRAP=True
- DB_MAX_TIMEOUT=60
-
list_join:
- '='
- - 'DB_CLUSTERCHECK_PASSWORD'
- {get_param: MysqlClustercheckPassword}
-
list_join:
- '='
- - 'DB_ROOT_PASSWORD'
-
yaql:
expression: $.data.passwords.where($ != '').first()
data:
passwords:
- {get_param: MysqlRootPassword}
- {get_param: [DefaultPasswords, mysql_root_password]}
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
KOLLA_BOOTSTRAP: true
DB_MAX_TIMEOUT: 60
DB_CLUSTERCHECK_PASSWORD: {get_param: MysqlClustercheckPassword}
DB_ROOT_PASSWORD:
yaql:
expression: $.data.passwords.where($ != '').first()
data:
passwords:
- {get_param: MysqlRootPassword}
- {get_param: [DefaultPasswords, mysql_root_password]}
step_2:
mysql_restart_bundle:
start_order: 0
Expand All @@ -265,7 +257,7 @@ outputs:
ipc: host
user: root
environment:
- TRIPLEO_MINOR_UPDATE
TRIPLEO_MINOR_UPDATE: ''
command: /pacemaker_restart_bundle.sh galera-bundle mysql
image: {get_param: ContainerMysqlImage}
volumes:
Expand Down Expand Up @@ -301,10 +293,7 @@ outputs:
environment:
# NOTE: this should force this container to re-run on each
# update (scale-out, etc.)
- list_join:
- ''
- - 'TRIPLEO_DEPLOY_IDENTIFIER='
- {get_param: DeployIdentifier}
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
4 changes: 2 additions & 2 deletions deployment/database/redis-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ outputs:
- /var/log/containers/redis:/var/log/redis:z
- /var/run/redis:/var/run/redis:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
- if:
- internal_tls_enabled
- redis_tls_proxy:
Expand All @@ -200,7 +200,7 @@ outputs:
- /etc/pki/tls/certs/redis.crt:/etc/pki/tls/certs/redis.crt:ro
- /etc/pki/tls/private/redis.key:/etc/pki/tls/private/redis.key:ro
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
- {}
metadata_settings:
if:
Expand Down
Loading

0 comments on commit bf60423

Please sign in to comment.