diff --git a/ansible/roles/loggearman/defaults/main.yml b/ansible/roles/loggearman/defaults/main.yml index 00cb888..cd53d66 100644 --- a/ansible/roles/loggearman/defaults/main.yml +++ b/ansible/roles/loggearman/defaults/main.yml @@ -10,6 +10,8 @@ container_images: loggearman: quay.rdoproject.org/software-factory/loggearman:latest # Gearman client +gearman_client_host: 0.0.0.0 +gearman_client_port: 4730 source_url: "" zmq_publishers: [] subunit_files: [] @@ -17,7 +19,7 @@ source_files: [] # Gearman worker gearman_host: 0.0.0.0 -gearman_port: 4731 +gearman_port: 4730 output_host: logstash.example.com output_port: 9999 output_mode: tcp diff --git a/ansible/roles/loggearman/templates/client.yml.j2 b/ansible/roles/loggearman/templates/client.yml.j2 index 359f350..df01c77 100644 --- a/ansible/roles/loggearman/templates/client.yml.j2 +++ b/ansible/roles/loggearman/templates/client.yml.j2 @@ -1,4 +1,6 @@ --- +gearman-host: {{ gearman_client_host }} +gearman-port: {{ gearman_client_port }} source-url: {{ source_url }} zmq-publishers: {{ zmq_publishers }} subunit-files: {{ subunit_files }} diff --git a/loggearman/loggearman/client.py b/loggearman/loggearman/client.py index 8eb0f5a..5dbff17 100755 --- a/loggearman/loggearman/client.py +++ b/loggearman/loggearman/client.py @@ -167,7 +167,9 @@ class Server(object): def setup_processors(self): for publisher in self.config['zmq-publishers']: gearclient = gear.Client() - gearclient.addServer('localhost') + host = self.config.get('gearman-host', 'localhost') + port = self.config.get('gearman-port', 4730) + gearclient.addServer(host, port=port) gearclient.waitForServer() log_processor = EventProcessor( publisher, gearclient, @@ -198,6 +200,7 @@ class Server(object): if statsd_host: self.wait_for_name_resolution(statsd_host, statsd_port) self.gearserver = gear.Server( + port=self.config.get('gearman-port', 4730), statsd_host=statsd_host, statsd_port=statsd_port, statsd_prefix=statsd_prefix)