-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helpers for testing in a local rundeck
- Loading branch information
1 parent
b8d4b3c
commit 93ad5ff
Showing
3 changed files
with
75 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM rundeck/rundeck:3.3.9 | ||
|
||
COPY rundeck-config-storage.properties /etc/remco/templates/rundeck-config-storage.properties | ||
|
||
USER root | ||
|
||
RUN chown rundeck:root /etc/remco/templates/rundeck-config-storage.properties | ||
|
||
USER rundeck |
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,58 @@ | ||
{% set providerBase = "/rundeck/storage/provider" %} | ||
{% set converterBase = "/rundeck/storage/converter" %} | ||
{% set configConverterBase = "/rundeck/config/storage/converter" %} | ||
|
||
|
||
{%- macro storage_provider(provider) %} | ||
{%- set index = provider | base %} | ||
{%- set type = getv(printf("%s/type", provider), "db") %} | ||
{% if type == 'db' || type == 'file' %} | ||
rundeck.storage.provider.{{index}}.type={% set type = printf("%s/type", provider) %}{{ getv(type, "db")}} | ||
rundeck.storage.provider.{{index}}.path={% set path = printf("%s/path", provider) %}{{ getv(path, "keys")}} | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{%- macro storage_converter(converter) %} | ||
{%- set index = converter | base %} | ||
rundeck.storage.converter.{{index}}.type={% set type = printf("%s/type", converter) %}{{ getv(type, "jasypt-encryption") }} | ||
rundeck.storage.converter.{{index}}.path={% set path = printf("%s/path", converter) %}{{ getv(path, "keys") }} | ||
rundeck.storage.converter.{{index}}.config.encryptorType={% set encryptortype = printf("%s/config/encryptortype", converter) %}{{ getv(encryptortype, "custom") }} | ||
rundeck.storage.converter.{{index}}.config.password={% set password = printf("%s/config/password", converter) %}{{ getv(password, "") }} | ||
rundeck.storage.converter.{{index}}.config.algorithm={% set algorithm = printf("%s/config/algorithm", converter) %}{{ getv(algorithm, "PBEWITHSHA256AND128BITAES-CBC-BC") }} | ||
rundeck.storage.converter.{{index}}.config.provider={% set provider = printf("%s/config/provider", converter) %}{{ getv(provider, "BC") }} | ||
rundeck.storage.converter.{{index}}.config.keyArn={% set keyArn = printf("%s/config/keyarn", converter) %}{{ getv(keyArn, "") }} | ||
{% endmacro %} | ||
|
||
{%- macro config_storage_converter(converter) %} | ||
{%- set index = converter | base %} | ||
rundeck.config.storage.converter.{{index}}.type={% set type = printf("%s/type", converter) %}{{ getv(type, "jasypt-encryption") }} | ||
rundeck.config.storage.converter.{{index}}.path={% set path = printf("%s/path", converter) %}{{ getv(path, "projects") }} | ||
rundeck.config.storage.converter.{{index}}.config.encryptorType={% set encryptortype = printf("%s/config/encryptortype", converter) %}{{ getv(encryptortype, "custom") }} | ||
rundeck.config.storage.converter.{{index}}.config.password={% set password = printf("%s/config/password", converter) %}{{ getv(password, "") }} | ||
rundeck.config.storage.converter.{{index}}.config.algorithm={% set algorithm = printf("%s/config/algorithm", converter) %}{{ getv(algorithm, "PBEWITHSHA256AND128BITAES-CBC-BC") }} | ||
rundeck.config.storage.converter.{{index}}.config.provider={% set provider = printf("%s/config/provider", converter) %}{{ getv(provider, "BC") }} | ||
rundeck.config.storage.converter.{{index}}.config.keyArn={% set keyArn = printf("%s/config/keyarn", converter) %}{{ getv(keyArn, "") }} | ||
{% endmacro %} | ||
|
||
{%- if ls(printf("%s/1", providerBase)) | length == 0 %} | ||
rundeck.storage.provider.1.type=db | ||
rundeck.storage.provider.1.path=keys | ||
{% endif %} | ||
|
||
|
||
{%- for p in lsdir(providerBase) -%} | ||
{% set provider = printf("%s/%s", providerBase, p) -%} | ||
{{ storage_provider(provider) }} | ||
{%- endfor %} | ||
|
||
{%- for c in lsdir(converterBase) %} | ||
{% set converter = printf("%s/%s", converterBase, c) -%} | ||
{{ storage_converter(converter) }} | ||
{%- endfor %} | ||
|
||
rundeck.projectsStorageType={{ getv("/rundeck/projectsstoragetype", "db") }} | ||
|
||
{% for c in lsdir(configConverterBase) %} | ||
{% set converter = printf("%s/%s", configConverterBase, c) -%} | ||
{{ config_storage_converter(converter) }} | ||
{%- endfor %} |
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,9 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
docker build -t rundeck-kms-test-image test-image | ||
|
||
docker run -it \ | ||
-e AWS_ACCESS_KEY_ID \ | ||
-e AWS_SECRET_ACCESS_KEY \ | ||
-e AWS_REGION \ | ||
-e RUNDECK_STORAGE_CONVERTER_1_TYPE=rundeck-kms-plugin \ | ||
-e RUNDECK_STORAGE_CONVERTER_1_PATH=keys \ | ||
-e RUNDECK_STORAGE_CONVERTER_1_CONFIG_KEYARN=$KMS_KEY_ARN \ | ||
-p 4440:4440 \ | ||
-v $(pwd)/lib/build/libs/rundeck-kms-plugin.jar:/home/rundeck/libext/rundeck-kms-plugin.jar \ | ||
rundeck/rundeck:3.3.9 | ||
rundeck-kms-test-image |