From 2973cea227b0d9530793e947999d1dfcc1cf6919 Mon Sep 17 00:00:00 2001
From: Sam Bonner <samb@catalyst.net.nz>
Date: Tue, 11 Jul 2017 17:38:18 +1200
Subject: [PATCH] Add handling to correctly sync password config out to slace
 webservers within a webpack

---
 http_basic_auth/drush/http_basic_auth.drush.inc | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/http_basic_auth/drush/http_basic_auth.drush.inc b/http_basic_auth/drush/http_basic_auth.drush.inc
index 33f8dee..28081ca 100644
--- a/http_basic_auth/drush/http_basic_auth.drush.inc
+++ b/http_basic_auth/drush/http_basic_auth.drush.inc
@@ -55,7 +55,19 @@ function _http_basic_auth_create_file($uri, $data, $user, $pass) {
     provision_file()->chmod($path, 0644);
 
     // Sync the password out to the server.
-    d()->service('http')->sync($path);
+    // Logic added to handle pack web server setups
+    $site_platform = d()->platform->name;
+    $web_server = d("$site_platform")->web_server->name;
+    $http_service_type = d("$web_server")->http_service_type;
+    if ($http_service_type == 'pack') {
+      $slave_servers = d("$web_server")->slave_web_servers;
+      foreach ($slave_servers as $slave_server) {
+        d("$slave_server")->service('http')->sync($path);
+      }
+    }
+    else {
+      d()->service('http')->sync($path);
+    }
   }
 
   return $path;
-- 
2.7.4

