diff --git a/roles/debian/aws_cloudwatch_agent/defaults/main.yml b/roles/debian/aws_cloudwatch_agent/defaults/main.yml index 36d3d3751..48824bcf3 100644 --- a/roles/debian/aws_cloudwatch_agent/defaults/main.yml +++ b/roles/debian/aws_cloudwatch_agent/defaults/main.yml @@ -7,6 +7,9 @@ aws_cloudwatch_agent: # Group prefix. Useful for grouping by environments. # Eg. instead of "syslog", you can have "dev syslog", "prod syslog", etc. log_group_prefix: "" + # Enable collectd integration + collectd: + enabled: false # You'd normally use IAM policies, but that allows # non-AWS servers to log in cloudwatch too. use_credentials: false diff --git a/roles/debian/aws_cloudwatch_agent/templates/config.json.j2 b/roles/debian/aws_cloudwatch_agent/templates/config.json.j2 index 169ea4c53..2bc9d789e 100755 --- a/roles/debian/aws_cloudwatch_agent/templates/config.json.j2 +++ b/roles/debian/aws_cloudwatch_agent/templates/config.json.j2 @@ -108,6 +108,11 @@ ], "metrics_collection_interval": 60 } + {%- if aws_cloudwatch_agent.collectd is defined and aws_cloudwatch_agent.collectd.enabled %} + ,"collectd": { + "metrics_aggregation_interval": 60 + } + {%- endif %} } } } \ No newline at end of file diff --git a/roles/debian/collectd/handlers/main.yml b/roles/debian/collectd/handlers/main.yml new file mode 100644 index 000000000..d80ca70d1 --- /dev/null +++ b/roles/debian/collectd/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: Restart collectd + ansible.builtin.service: + name: collectd + state: restarted diff --git a/roles/debian/collectd/tasks/main.yml b/roles/debian/collectd/tasks/main.yml index 7f2505e38..6cf5aa76a 100644 --- a/roles/debian/collectd/tasks/main.yml +++ b/roles/debian/collectd/tasks/main.yml @@ -34,3 +34,10 @@ force: true when: - collectd_configdir.stat.exists + notify: Restart collectd + +- name: Ensure collectd service is enabled and started. + ansible.builtin.service: + name: collectd + state: started + enabled: true diff --git a/roles/debian/gitlab/tasks/main.yml b/roles/debian/gitlab/tasks/main.yml index 908d10a7a..9b08481cc 100644 --- a/roles/debian/gitlab/tasks/main.yml +++ b/roles/debian/gitlab/tasks/main.yml @@ -147,7 +147,7 @@ - name: Configure GitLab LE boot-time renewal timer when: - - gitlab.letsencrypt + - gitlab.letsencrypt_timer - gitlab_ctl_binary.stat.exists block: - name: Install systemd service for LE renewal