galera bootstrap improvements
Conflicts:
galera/master.sls
galera/slave.sls
diff --git a/galera/files/slave_bootstrap.sh b/galera/files/bootstrap.sh
similarity index 95%
rename from galera/files/slave_bootstrap.sh
rename to galera/files/bootstrap.sh
index 8e163dc..b4a3122 100644
--- a/galera/files/slave_bootstrap.sh
+++ b/galera/files/bootstrap.sh
@@ -3,7 +3,7 @@
service {{ slave.service }} start
-counter=40
+counter=70
while [ $counter -gt 0 ]
do
diff --git a/galera/master.sls b/galera/master.sls
index 0849f2b..cb844e0 100644
--- a/galera/master.sls
+++ b/galera/master.sls
@@ -56,7 +56,7 @@
- require:
- pkg: galera_packages
-{%- if salt['cmd.run']('test -e /root/.galera_bootstrap; echo $?') != '0' %}
+{%- if salt['cmd.run']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %}
galera_bootstrap_temp_config:
file.managed:
@@ -69,8 +69,10 @@
- file: galera_init_script
galera_bootstrap_start_service:
- service.running:
- - name: {{ master.service }}
+ cmd.script:
+ - name: master_initial_bootstrap
+ - source: salt://galera/files/bootstrap.sh
+ - template: jinja
- require:
- file: galera_bootstrap_temp_config
@@ -78,7 +80,7 @@
cmd.run:
- name: mysqladmin password "{{ master.admin.password }}"
- require:
- - service: galera_bootstrap_start_service
+ - cmd: galera_bootstrap_start_service
mysql_bootstrap_update_maint_password:
cmd.run:
@@ -102,16 +104,17 @@
- service: galera_bootstrap_stop_service
galera_bootstrap_start_service_final:
- service.running:
- - name: {{ master.service }}
+ cmd.script:
+ - name: master_bootstrap
+ - source: salt://galera/files/bootstrap.sh
- require:
- file: galera_bootstrap_init_config
galera_bootstrap_finish_flag:
file.touch:
- - name: /root/.galera_bootstrap
+ - name: /var/lib/mysql/.galera_bootstrap
- require:
- - service: galera_bootstrap_start_service_final
+ - cmd: galera_bootstrap_start_service_final
- watch_in:
- file: galera_config
diff --git a/galera/slave.sls b/galera/slave.sls
index 0eb9632..dfd30b9 100644
--- a/galera/slave.sls
+++ b/galera/slave.sls
@@ -56,7 +56,7 @@
- require:
- pkg: galera_packages
-{%- if salt['cmd.run']('test -e /root/.galera_bootstrap; echo $?') != '0' %}
+{%- if salt['cmd.run']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %}
galera_bootstrap_temp_config:
file.managed:
@@ -69,8 +69,10 @@
- file: galera_init_script
galera_bootstrap_start_service:
- service.running:
- - name: {{ slave.service }}
+ cmd.script:
+ - name: slave_initial_bootstrap
+ - source: salt://galera/files/bootstrap.sh
+ - template: jinja
- require:
- file: galera_bootstrap_temp_config
@@ -78,7 +80,7 @@
cmd.run:
- name: mysqladmin password "{{ slave.admin.password }}"
- require:
- - service: galera_bootstrap_start_service
+ - cmd: galera_bootstrap_start_service
mysql_bootstrap_update_maint_password:
cmd.run:
@@ -104,14 +106,18 @@
galera_bootstrap_start_service_final:
cmd.script:
- name: slave_bootstrap
+<<<<<<< HEAD
- source: salt://galera/files/slave_bootstrap.sh
- template: jinja
+=======
+ - source: salt://galera/files/bootstrap.sh
+>>>>>>> 5f0d683... galera bootstrap improvements
- require:
- file: galera_bootstrap_init_config
galera_bootstrap_finish_flag:
file.touch:
- - name: /root/.galera_bootstrap
+ - name: /var/lib/mysql/.galera_bootstrap
- require:
- cmd: galera_bootstrap_start_service_final
- watch_in: