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

Commit

Permalink
Use kolla_config for other actions
Browse files Browse the repository at this point in the history
Today for some services we mount in /var/lib/config-data/<service>/etc
which is actually an output from the container-puppet process. We should
be using kolla to ensure that we properly create the configurations
based on the puppet generated configurations and things in the
container.  Some services correctly leverage the kolla_config that the
associated api/service uses when running their db sync. This patch
aligns the rest to follow the similar pattern.

Change-Id: I0e3d5748a50937880a55413b75fe6eca479c9160
  • Loading branch information
mwhahaha committed Jun 2, 2021
1 parent a96a8bf commit 8e05271
Show file tree
Hide file tree
Showing 22 changed files with 282 additions and 153 deletions.
19 changes: 14 additions & 5 deletions deployment/aodh/aodh-api-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ outputs:
kolla_config:
/var/lib/kolla/config_files/aodh_api.json:
command: /usr/sbin/httpd -DFOREGROUND
config_files:
config_files: &aodh_api_config_files
- source: "/var/lib/kolla/config_files/src/etc/httpd/conf.d"
dest: "/etc/httpd/conf.d"
merge: false
Expand All @@ -222,10 +222,14 @@ outputs:
dest: "/"
merge: true
preserve_properties: true
permissions:
permissions: &aodh_api_permissions
- path: /var/log/aodh
owner: aodh:aodh
recurse: true
/var/lib/kolla/config_files/aodh_api_db_sync.json:
command: "/usr/bin/bootstrap_host_exec aodh_api su aodh -s /bin/bash -c /usr/bin/aodh-dbsync"
config_files: *aodh_api_config_files
permissions: *aodh_api_permissions
/var/lib/kolla/config_files/aodh_api_cron.json:
command: /usr/sbin/crond -n
config_files:
Expand Down Expand Up @@ -258,12 +262,16 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- - /var/lib/config-data/aodh/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
- /var/lib/config-data/aodh/etc/aodh/:/etc/aodh/:ro
- - /var/lib/kolla/config_files/aodh_api_db_sync.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/aodh:/var/lib/kolla/config_files/src:ro
- /var/log/containers/aodh:/var/log/aodh
- /var/log/containers/httpd/aodh-api:/var/log/httpd
command: "/usr/bin/bootstrap_host_exec aodh_api su aodh -s /bin/bash -c /usr/bin/aodh-dbsync"
- if:
- {get_param: EnableInternalTLS}
- - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
- /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
step_4:
aodh_api:
Expand All @@ -284,6 +292,7 @@ outputs:
- {get_param: EnableInternalTLS}
- - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
- /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro

environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
aodh_api_cron:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ outputs:
kolla_config:
/var/lib/kolla/config_files/ceilometer_agent_central.json:
command: /usr/bin/ceilometer-polling --polling-namespaces central --logfile /var/log/ceilometer/central.log
config_files:
config_files: &ceilometer_agent_config_files
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
/var/lib/kolla/config_files/ceilometer_agent_gnocchi_upgrade.json:
command: "/usr/bin/bootstrap_host_exec ceilometer_agent_central su ceilometer -s /bin/bash -c 'for n in {1..10}; do /usr/bin/ceilometer-upgrade && exit 0 || sleep 30; done; exit 1'"
config_files: *ceilometer_agent_config_files
docker_config:
step_3:
ceilometer_init_log:
Expand Down Expand Up @@ -145,12 +148,11 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- - /var/lib/config-data/ceilometer/etc/ceilometer/:/etc/ceilometer/:ro
- - /var/lib/kolla/config_files/ceilometer_agent_gnocchi_upgrade.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/ceilometer:/var/lib/kolla/config_files/src:ro
- /var/log/containers/ceilometer:/var/log/ceilometer:z
command:
- '/usr/bin/bootstrap_host_exec'
- 'ceilometer_agent_central'
- "su ceilometer -s /bin/bash -c 'for n in {1..10}; do /usr/bin/ceilometer-upgrade && exit 0 || sleep 30; done; exit 1'"
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
30 changes: 17 additions & 13 deletions deployment/cinder/cinder-api-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ outputs:
kolla_config:
/var/lib/kolla/config_files/cinder_api.json:
command: /usr/sbin/httpd -DFOREGROUND
config_files:
config_files: &cinder_api_config_files
- source: "/var/lib/kolla/config_files/src/etc/httpd/conf.d"
dest: "/etc/httpd/conf.d"
merge: false
Expand All @@ -244,14 +244,18 @@ outputs:
merge: true
preserve_properties: true
optional: true
permissions:
permissions: &cinder_api_permissions
- path: /var/log/cinder
owner: cinder:cinder
recurse: true
- path: /etc/pki/tls/certs/etcd.crt
owner: cinder:cinder
- path: /etc/pki/tls/private/etcd.key
owner: cinder:cinder
/var/lib/kolla/config_files/cinder_api_db_sync.json:
command: "/usr/bin/bootstrap_host_exec cinder_api su cinder -s /bin/bash -c 'cinder-manage db sync --bump-versions'"
config_files: *cinder_api_config_files
permissions: *cinder_api_permissions
/var/lib/kolla/config_files/cinder_api_cron.json:
command: /usr/sbin/crond -n
config_files:
Expand Down Expand Up @@ -284,16 +288,15 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/cinder/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
- /var/lib/config-data/cinder/etc/cinder/:/etc/cinder/:ro
- - /var/lib/kolla/config_files/cinder_api_db_sync.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/cinder:/var/lib/kolla/config_files/src:ro
- /var/log/containers/cinder:/var/log/cinder:z
- /var/log/containers/httpd/cinder-api:/var/log/httpd:z
command:
- '/usr/bin/bootstrap_host_exec'
- 'cinder_api'
- "su cinder -s /bin/bash -c 'cinder-manage db sync --bump-versions'"
- if:
- {get_param: EnableInternalTLS}
- - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
- /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
step_4:
cinder_api:
Expand All @@ -308,9 +311,10 @@ outputs:
test: /openstack/healthcheck
volumes:
list_concat:
- {get_attr: [CinderCommon, cinder_common_volumes]}
- {get_attr: [ContainersCommon, volumes]}
- - /var/lib/kolla/config_files/cinder_api.json:/var/lib/kolla/config_files/config.json:ro
- /var/log/containers/httpd/cinder-api:/var/log/httpd:z
- /var/lib/config-data/puppet-generated/cinder:/var/lib/kolla/config_files/src:ro
- /var/log/containers/cinder:/var/log/cinder:z
- if:
- {get_param: EnableInternalTLS}
- - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
Expand Down Expand Up @@ -345,7 +349,7 @@ outputs:
step_config: 'include tripleo::profile::base::cinder::api'
config_image: *cinder_api_image
volumes:
- /var/lib/config-data/cinder/etc/cinder/:/etc/cinder/:ro
- /var/lib/config-data/puppet-generated/cinder/etc/cinder/:/etc/cinder/:ro

metadata_settings:
get_attr: [ApacheServiceBase, role_data, metadata_settings]
Expand Down
30 changes: 21 additions & 9 deletions deployment/deprecated/mistral/mistral-api-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,26 @@ outputs:
kolla_config:
/var/lib/kolla/config_files/mistral_api.json:
command: /usr/bin/mistral-server --config-file=/etc/mistral/mistral.conf --log-file=/var/log/mistral/api.log --server=api
config_files:
config_files: &mistral_api_config_files
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
permissions: &mistral_api_permissions
- path: /var/log/mistral
owner: mistral:mistral
recurse: true
/var/lib/kolla/config_files/mistral_api_db_sync.json:
command: "/usr/bin/bootstrap_host_exec mistral_api su mistral -s /bin/bash -c 'mistral-db-manage --config-file /etc/mistral/mistral.conf --openstack_actions_mapping_path=/etc/mistral/mapping.json upgrade head'"
config_files: *mistral_api_config_files
permissions: *mistral_api_permissions
/var/lib/kolla/config_files/mistral_api_db_populate.json:
# NOTE: dprince this requires that we install openstack-tripleo-common into
# the Mistral API image so that we get tripleo* actions
command: "/usr/bin/bootstrap_host_exec mistral_api su mistral -s /bin/bash -c 'mistral-db-manage --config-file /etc/mistral/mistral.conf --openstack_actions_mapping_path=/etc/mistral/mapping.json populate'"
config_files: *mistral_api_config_files
permissions: *mistral_api_permissions

docker_config:
# db sync runs before permissions set by kolla_config
step_2:
Expand All @@ -198,10 +209,11 @@ outputs:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/mistral/etc/mistral/:/etc/mistral/:ro
- /var/lib/kolla/config_files/mistral_api_db_sync.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/mistral:/var/lib/kolla/config_files/src:ro
- /var/log/containers/mistral:/var/log/mistral:z
command: "/usr/bin/bootstrap_host_exec mistral_api su mistral -s /bin/bash -c 'mistral-db-manage --config-file /etc/mistral/mistral.conf --openstack_actions_mapping_path=/etc/mistral/mapping.json upgrade head'"
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
step_4:
mistral_api:
Expand Down Expand Up @@ -233,11 +245,11 @@ outputs:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/mistral/etc/mistral/:/etc/mistral/:ro
- /var/lib/kolla/config_files/mistral_api_db_populate.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/mistral:/var/lib/kolla/config_files/src:ro
- /var/log/containers/mistral:/var/log/mistral:z
# NOTE: dprince this requires that we install openstack-tripleo-common into
# the Mistral API image so that we get tripleo* actions
command: "/usr/bin/bootstrap_host_exec mistral_api su mistral -s /bin/bash -c 'mistral-db-manage --config-file /etc/mistral/mistral.conf --openstack_actions_mapping_path=/etc/mistral/mapping.json populate'"
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand All @@ -252,7 +264,7 @@ outputs:
when: step|int == 3
copy:
content: {get_file: ./mapping.json}
dest: '/var/lib/config-data/mistral/etc/mistral/mapping.json'
dest: '/var/lib/config-data/puppet-generated/mistral/etc/mistral/mapping.json'
setype: container_file_t
force: yes
mode: '0755'
11 changes: 7 additions & 4 deletions deployment/deprecated/zaqar/zaqar-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ outputs:
kolla_config:
/var/lib/kolla/config_files/zaqar.json:
command: /usr/sbin/httpd -DFOREGROUND
config_files:
config_files: &zaqar_config_files
- source: "/var/lib/kolla/config_files/src/etc/httpd/conf.d"
dest: "/etc/httpd/conf.d"
merge: false
Expand All @@ -282,6 +282,9 @@ outputs:
dest: "/"
merge: true
preserve_properties: true
/var/lib/kolla/config_files/zaqar_db_sync.json:
command: "/usr/bin/bootstrap_host_exec zaqar_api su zaqar -s /bin/bash -c 'zaqar-sql-db-manage upgrade head'"
config_files: *zaqar_config_files
/var/lib/kolla/config_files/zaqar_websocket.json:
command: /usr/bin/zaqar-server --config-file /etc/zaqar/zaqar.conf --config-file /etc/zaqar/1.conf
config_files:
Expand Down Expand Up @@ -319,11 +322,11 @@ outputs:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/zaqar/etc/zaqar/:/etc/zaqar/:ro
- /var/lib/kolla/config_files/zaqar_db_sync.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/zaqar:/var/lib/kolla/config_files/src:ro
- /var/log/containers/zaqar:/var/log/zaqar
- /var/log/containers/httpd/zaqar:/var/log/httpd
command: "/usr/bin/bootstrap_host_exec zaqar_api su zaqar -s /bin/bash -c 'zaqar-sql-db-manage upgrade head'"
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
- {}
- step_4:
Expand Down
3 changes: 2 additions & 1 deletion deployment/etcd/etcd-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ outputs:
step_config: |
include tripleo::profile::base::etcd
config_image: *etcd_config_image
# TODO(mwhahaha): need to check if this works correctly or we need to switch to a bootstrap execution
volumes:
- /var/lib/config-data/etcd/etc/etcd/:/etc/etcd:ro
- /var/lib/config-data/puppet-generated/etcd/etc/etcd/:/etc/etcd:ro
- /var/lib/etcd:/var/lib/etcd:ro
deploy_steps_tasks:
if:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,23 @@ outputs:
kolla_config:
/var/lib/kolla/config_files/designate_central.json:
command: /usr/bin/designate-central --config-file=/etc/designate/designate.conf --log-file=/var/log/designate/central.log
config_files:
config_files: &designate_central_config_files
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
permissions: &designate_central_permissions
- path: /var/log/designate
owner: designate:designate
recurse: true
/var/lib/kolla/config_files/designate_central_db_sync.json:
command: "/usr/bin/bootstrap_host_exec designate_central su designate -s /bin/bash -c 'designate-manage --config-file /etc/designate/designate.conf database sync'"
config_files: *designate_central_config_files
permissions: *designate_central_permissions
/var/lib/kolla/config_files/designate_central_pool_manage.json:
command: "/usr/bin/bootstrap_host_exec designate_central su designate -s /bin/bash -c '/bin/designate-manage pool update'"
config_files: *designate_central_config_files
permissions: *designate_central_permissions
deploy_steps_tasks:
- name: generate designate pool
when: step|int == 4
Expand Down Expand Up @@ -170,11 +178,12 @@ outputs:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/designate/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
- /var/lib/config-data/designate/etc/designate/:/etc/designate/:ro
- /run:/run
- /var/lib/kolla/config_files/designate_central_db_sync.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/designate:/var/lib/kolla/config_files/src:ro
- /var/log/containers/designate:/var/log/designate:z
command: "/usr/bin/bootstrap_host_exec designate_central su designate -s /bin/bash -c 'designate-manage --config-file /etc/designate/designate.conf database sync'"
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
step_4:
designate_central:
Expand Down Expand Up @@ -205,9 +214,12 @@ outputs:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/puppet-generated/designate/etc/designate/:/etc/designate/:ro
- /run:/run
- /var/lib/kolla/config_files/designate_central_pool_manage.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/designate:/var/lib/kolla/config_files/src:ro
- /var/log/containers/designate:/var/log/designate:z
command: "/usr/bin/bootstrap_host_exec designate_central su designate -s /bin/bash -c '/bin/designate-manage pool update'"
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
Expand Down
19 changes: 13 additions & 6 deletions deployment/heat/heat-engine-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,19 @@ outputs:
- ' '
- - /usr/bin/heat-engine --config-file /usr/share/heat/heat-dist.conf --config-file /etc/heat/heat.conf
- get_attr: [HeatEngineLogging, cmd_extra_args]
config_files:
config_files: &heat_engine_config_files
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
permissions: &heat_engine_permissions
- path: /var/log/heat
owner: heat:heat
recurse: true
/var/lib/kolla/config_files/heat_engine_db_sync.json:
command: "/usr/bin/bootstrap_host_exec heat_engine su heat -s /bin/bash -c 'heat-manage db_sync'"
config_files: *heat_engine_config_files
permissions: *heat_engine_permissions
docker_config:
# db sync runs before permissions set by kolla_config
step_2:
Expand All @@ -249,12 +253,15 @@ outputs:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [HeatEngineLogging, volumes]}
- {get_param: HeatEngineOptVolumes}
-
- /var/lib/config-data/heat/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
- /var/lib/config-data/heat/etc/heat/:/etc/heat/:ro
command: "/usr/bin/bootstrap_host_exec heat_engine su heat -s /bin/bash -c 'heat-manage db_sync'"
- /var/lib/kolla/config_files/heat_engine_db_sync.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/heat:/var/lib/kolla/config_files/src:ro
environment:
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
map_merge:
- {get_param: HeatEngineOptEnvVars}
- KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
step_4:
heat_engine:
image: *heat_engine_image
Expand Down
Loading

0 comments on commit 8e05271

Please sign in to comment.