Skip to content

Commit

Permalink
Merge pull request #18 from remerge/support-logging-cong
Browse files Browse the repository at this point in the history
Support specification of nomad logging config
  • Loading branch information
tundeaoni authored Jul 7, 2023
2 parents cc833c1 + 69cc6e3 commit 89b1258
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,13 @@
quiet: true
when:
- nomad_docker_auth_enabled

- name: assert | Test if nomad_docker_logging is set correctly
ansible.builtin.assert:
that:
- nomad_docker_logging.type is defined
- nomad_docker_logging.config is defined
- nomad_docker_logging.config is iterable
quiet: true
when:
- nomad_docker_logging is defined
12 changes: 12 additions & 0 deletions templates/client.hcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ client {

plugin "docker" {
config {

{% if nomad_docker_logging is defined %}
logging {
type = "{{ nomad_docker_logging['type'] }}"
config {
{% for key , value in nomad_docker_logging['config'].items() %}
{{ key }} = "{{ value }}"
{% endfor %}
}
}
{% endif %}

{% if nomad_docker_auth_enabled is sameas true %}
auth {
config = "{{ nomad_docker_auth_file }}"
Expand Down

0 comments on commit 89b1258

Please sign in to comment.