Skip to content

Commit

Permalink
Merge pull request #38 from threatstack/ruleset-fix
Browse files Browse the repository at this point in the history
Support threatstack_ruleset array of values
  • Loading branch information
jbaublitz committed Aug 9, 2018
2 parents e2de58a + 7ed7f8b commit ce40163
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ provisioner:
threatstack_pkg: <%= ENV['TS_PACKAGE_VERSION'] %>
<% end %>
<% if ENV['TS_RULE_SETS'] %>
threatstack_ruleset: "<%= ENV['TS_RULE_SETS'] != nil ? ENV['TS_RULE_SETS'] : 'Base Rule Set' %>"
threatstack_ruleset: "<%= ENV['TS_RULE_SETS'] %>"
<% end %>

platforms:
Expand Down
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ threatstack_pkg_state: installed
# to set a version of the agent use threatstack-agent=X.Y.Z
threatstack_pkg: threatstack-agent
#threatstack_hostname:
#threatstack_ruleset:
threatstack_ruleset:
- 'Base Rule Set'
threatstack_config_dir: '/etc/threatstack'
threatstack_config: "{{ threatstack_config_dir }}/tsconfig.json"
threatstack_configure_agent: true
Expand Down
4 changes: 2 additions & 2 deletions templates/config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{% if threatstack_hostname is defined %}
"hostname": "{{ threatstack_hostname }}",
{% endif %}
{% if threatstack_ruleset is defined %}
"ruleset": "{{ threatstack_ruleset }}",
{% if threatstack_ruleset | length > 0 %}
"ruleset": "{{ threatstack_ruleset | join(",") }}",
{% endif %}
"deploy-key": "{{ threatstack_deploy_key | mandatory }}"
}
3 changes: 2 additions & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
vars:
timestamp: "{{ lookup('pipe', 'date +%Y%m%d') }}"
threatstack_deploy_key: "{{ lookup('env','API_KEY') }}"
threatstack_ruleset: 'Travis Rule Set'
threatstack_ruleset:
- 'Travis Rule Set'
threatstack_hostname: 'TravisCI_{{timestamp}}'
threatstack_config_dir: '/etc/threatstack'
threatstack_config: "{{ threatstack_config_dir }}/tsconfig.json"
Expand Down

0 comments on commit ce40163

Please sign in to comment.