-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GITHUB-40] Add support for custom environment varaibles
When for instance you want to use NewRelic java agent, you can use ```YAML - role: sansible.kafka sansible_kafka_environment_vars: - "NEWRELIC_OPTS=\"-javaagent:/home/{{ sansible_kafka_user }}/newrelic/newrelic.jar\"" - "export KAFKA_OPTS=\"${KAFKA_OPTS} ${NEWRELIC_OPTS}\"" ```
- Loading branch information
1 parent
ece21db
commit 61f99b9
Showing
7 changed files
with
61 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v3.0 | ||
v3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') | ||
|
||
|
||
def test_server_properties(host): | ||
server_properties = host.file( | ||
'/home/kafka/etc/server.properties' | ||
).content_string | ||
|
||
assert 'listeners=PLAINTEXT://127.0.0.1:9092' \ | ||
in server_properties | ||
assert 'broker.id=11' \ | ||
in server_properties | ||
assert 'zookeeper.connect=' \ | ||
in server_properties | ||
|
||
|
||
def test_environment_properties(host): | ||
server_environments = host.file( | ||
'/home/kafka/etc/environment' | ||
).content_string | ||
|
||
assert 'NEWRELIC_OPTS="-javaagent:/home/kafka/newrelic/newrelic.jar"' \ | ||
in server_environments | ||
assert 'export TEST_KAFKA_OPTS="${KAFKA_OPTS} ${NEWRELIC_OPTS}"' \ | ||
in server_environments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters