diff --git a/resources/providers/config.rb b/resources/providers/config.rb index 988c5f2..78af146 100644 --- a/resources/providers/config.rb +++ b/resources/providers/config.rb @@ -75,7 +75,6 @@ group 'root' mode '0755' retries 2 - variables(master_node: get_master(postgresql_vrrp, postgresql_iface, managers)) end template '/usr/lib/redborder/bin/rb_keepalived_backup_notify_postgresql.sh' do diff --git a/resources/templates/default/notify_backup_postgresql.erb b/resources/templates/default/notify_backup_postgresql.erb index 5a9e128..b5fa59c 100644 --- a/resources/templates/default/notify_backup_postgresql.erb +++ b/resources/templates/default/notify_backup_postgresql.erb @@ -1,7 +1,6 @@ #!/bin/bash MASTER_NODE=<%= @master_node %> -CURRENT_NODE=$(hostname -s) LOG_FILE=/tmp/rb_notify_postgresql_backup.log # Cleaning tmp files @@ -11,7 +10,5 @@ rm -f /tmp/rb_notify_postgresql* date >> "$LOG_FILE" echo "Executing rb_notify_backup_postgresql" >> "$LOG_FILE" -if [ $CURRENT_NODE != $MASTER_NODE ]; then - echo "Executing rb_sync_from_master.sh $MASTER_NODE" >> "$LOG_FILE" - /usr/lib/redborder/bin/rb_sync_from_master.sh $MASTER_NODE >> "$LOG_FILE" -fi \ No newline at end of file +echo "Executing rb_sync_from_master.sh $MASTER_NODE" >> "$LOG_FILE" +/usr/lib/redborder/bin/rb_sync_from_master.sh $MASTER_NODE >> "$LOG_FILE" \ No newline at end of file diff --git a/resources/templates/default/notify_master_postgresql.erb b/resources/templates/default/notify_master_postgresql.erb index 46720e5..3a9835b 100644 --- a/resources/templates/default/notify_master_postgresql.erb +++ b/resources/templates/default/notify_master_postgresql.erb @@ -1,7 +1,6 @@ #!/bin/bash MASTER_NODE=<%= @master_node %> -CURRENT_NODE=$(hostname -s) LOG_FILE=/tmp/rb_notify_postgresql_master.log # Cleaning tmp files @@ -11,9 +10,7 @@ rm -f /tmp/rb_notify_postgresql* date >> "$LOG_FILE" echo "Executing rb_notify_master_postgresql" >> "$LOG_FILE" -if [ $CURRENT_NODE == $MASTER_NODE ]; then - echo "Promoting to master" >> "$LOG_FILE" - touch /tmp/postgresql.trigger - sed -i '/^primary_conninfo/d' /var/lib/pgsql/data/postgresql.conf - sed -i '/^promote_trigger_file/d' /var/lib/pgsql/data/postgresql.conf -fi \ No newline at end of file +echo "Promoting to master" >> "$LOG_FILE" +touch /tmp/postgresql.trigger +sed -i '/^primary_conninfo/d' /var/lib/pgsql/data/postgresql.conf +sed -i '/^promote_trigger_file/d' /var/lib/pgsql/data/postgresql.conf \ No newline at end of file