pcs commands on host: mysql
This implements the creation of the haproxy bundle on the host. The testing protocol used is documented in the depends-on. The reason for adding a post_update task is that during a minor update the deployment tasks are not run during the node update procedure but only during the final converge. So we ran the role again there to make sure that any config change will trigger a restart during the minor update, so the disruption is only local to the single node being updated. If we did not do this a final converge could potentially trigger a global restart of HA bundles which would be quite disruptive. NB: in this case we keep the container init_bundle (renamed to wait_bundle) around just use it to wait for galera to be up. Depends-On: Iaa7e89f0d25221c2a6ef0b81eb88a6f496f01696 Change-Id: Ie14819b66cecdb5a9cc6299b68a0cc70a7aa3370 Related-Bug: #1863442
This commit is contained in:
parent
c4de191f02
commit
da3d5e8056
|
@ -264,7 +264,7 @@ outputs:
|
|||
- {get_param: MysqlRootPassword}
|
||||
- {get_param: [DefaultPasswords, mysql_root_password]}
|
||||
step_2:
|
||||
mysql_init_bundle:
|
||||
mysql_wait_bundle:
|
||||
start_order: 0
|
||||
detach: false
|
||||
net: host
|
||||
|
@ -274,8 +274,8 @@ outputs:
|
|||
list_concat:
|
||||
- - '/container_puppet_apply.sh'
|
||||
- '2'
|
||||
- 'file,file_line,concat,augeas,pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation,galera_ready,mysql_database,mysql_grant,mysql_user'
|
||||
- 'include tripleo::profile::base::pacemaker;include tripleo::profile::pacemaker::database::mysql_bundle'
|
||||
- 'file,file_line,concat,augeas,galera_ready,mysql_database,mysql_grant,mysql_user'
|
||||
- 'include tripleo::profile::pacemaker::database::mysql_bundle'
|
||||
- if:
|
||||
- puppet_debug_enabled
|
||||
- - '--debug'
|
||||
|
@ -294,21 +294,6 @@ outputs:
|
|||
# NOTE: this should force this container to re-run on each
|
||||
# update (scale-out, etc.)
|
||||
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
|
||||
mysql_restart_bundle:
|
||||
start_order: 1
|
||||
config_volume: mysql
|
||||
detach: false
|
||||
net: host
|
||||
ipc: host
|
||||
user: root
|
||||
environment:
|
||||
TRIPLEO_MINOR_UPDATE: ''
|
||||
command: /var/lib/container-config-scripts/pacemaker_restart_bundle.sh mysql galera galera-bundle Master
|
||||
image: {get_param: ContainerMysqlImage}
|
||||
volumes:
|
||||
list_concat:
|
||||
- {get_attr: [ContainersCommon, pacemaker_restart_volumes]}
|
||||
- - /var/lib/config-data/puppet-generated/mysql:/var/lib/kolla/config_files/src:ro
|
||||
host_prep_tasks:
|
||||
- name: create persistent directories
|
||||
file:
|
||||
|
@ -330,6 +315,21 @@ outputs:
|
|||
vars:
|
||||
container_image: {get_param: ContainerMysqlImage}
|
||||
container_image_latest: *mysql_image_pcmklatest
|
||||
- name: MySQL HA Wrappers Step
|
||||
when: step|int == 2
|
||||
block: &mysql_puppet_bundle
|
||||
- name: Mysql puppet bundle
|
||||
import_role:
|
||||
name: tripleo_ha_wrapper
|
||||
vars:
|
||||
tripleo_ha_wrapper_service_name: mysql
|
||||
tripleo_ha_wrapper_resource_name: galera
|
||||
tripleo_ha_wrapper_bundle_name: galera-bundle
|
||||
tripleo_ha_wrapper_resource_state: Master
|
||||
tripleo_ha_wrapper_puppet_config_volume: mysql
|
||||
tripleo_ha_wrapper_puppet_execute: 'include ::tripleo::profile::base::pacemaker; include ::tripleo::profile::pacemaker::database::mysql_bundle'
|
||||
tripleo_ha_wrapper_puppet_tags: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
|
||||
tripleo_ha_wrapper_puppet_debug: {get_param: ConfigDebug}
|
||||
|
||||
update_tasks:
|
||||
- name: Tear-down non-HA mysql container
|
||||
|
@ -388,6 +388,13 @@ outputs:
|
|||
when:
|
||||
- old_galera_image_id.stdout != new_galera_image_id.stdout
|
||||
|
||||
post_update_tasks:
|
||||
- name: Mysql bundle post update
|
||||
when: step|int == 1
|
||||
block: *mysql_puppet_bundle
|
||||
vars:
|
||||
tripleo_ha_wrapper_minor_update: true
|
||||
|
||||
upgrade_tasks:
|
||||
- name: Tear-down non-HA mysql container
|
||||
when:
|
||||
|
@ -539,7 +546,7 @@ outputs:
|
|||
name: tripleo_container_rm
|
||||
vars:
|
||||
tripleo_containers_to_rm:
|
||||
- mysql_init_bundle
|
||||
- mysql_wait_bundle
|
||||
when:
|
||||
- mysql_short_node_names_upgraded | length > 1
|
||||
- name: add the mysql short name to hiera data for the upgrade.
|
||||
|
|
Loading…
Reference in New Issue