Skip to content

Commit

Permalink
adding template variable & task for aws metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
opavader committed Sep 30, 2017
1 parent 49ea0d3 commit ec5292c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ ansible-galaxy install ansible-role-archagent
Role Variables
--------------

The license key can be set in the role's `default/main.yml` as below:
The license key is needed and can be set in the role's `default/main.yml` as below:

``` yml
archsaber_license: yourlicensekey
```
You can also use the `archagent_sync_data_config`, `archagent_sync_metric_config` variables along with their respective to sync the `archagent` config files.
You can also use the `archagent_sync_data_config`, `archagent_sync_metric_config` variables along with their respective templates to sync the `archagent` config files (`data.json` & `metrics.json`).


License
-------
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ archagent_sync_metric_config: false
archagent_rule_conf_name: default-rule
archagent_channel_conf_name: default-channel

archagent_data_conf_template: data.json.j2
archagent_aws_conf_template: aws.json.j2
archagent_metric_conf_template: metrics.json.j2

12 changes: 11 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,22 @@

- name: sync the data config
template:
src: data.json.j2
src: "{{archagent_data_conf_template}}"
dest: /etc/opt/archsaber/data.json
mode: 0644
when: archagent_sync_data_config
notify:
- restart archagent

- name: sync the aws metric config
template:
src: "{{archagent_aws_conf_template}}"
dest: /etc/opt/archsaber/aws.json
mode: 0644
when: archagent_sync_data_config
notify:
- restart archagent

- name: sync the metric config
template:
src: "{{archagent_metric_conf_template}}"
Expand All @@ -54,6 +63,7 @@
notify:
- restart archagent


- name: Ensure archagent is running
service:
name: archagent
Expand Down

0 comments on commit ec5292c

Please sign in to comment.