Fix undefined variable in cadvisor role

When running latest kayobe on alaska, needed to ensure the correct
monitoring configuration was applied, I hit undefined variables,
hitting errors such as:

  The task includes an option with an undefined variable.
  The error was: 'nodeexporter_restart_policy' is undefined

On inspecting the role, it seems some cut and paste errors from the
nodeexporter role have snook in. The command is not required for the
docker_container directive, its not specified in the defaults.

Interestingly this triggered when I was just trying to redeploy haproxy.
This commit is contained in:
John Garbutt 2018-01-29 11:35:20 +00:00
parent 78a1623741
commit 4d533b07ff

View File

@ -3,13 +3,12 @@
docker_container:
image: "{{ item.value.image }}"
name: "{{ item.value.container_name }}"
command: "{{ item.value.command }}"
network_mode: "host"
privileged: "{{ item.value.privileged | default(omit) }}"
published_ports: "{{ item.value.published_ports | default(omit) }}"
read_only: "{{ item.value.read_only | default(omit) }}"
restart_policy: "{{ nodeexporter_restart_policy }}"
restart_retries: "{{ nodeexporter_restart_retries | default(omit) }}"
restart_policy: "{{ cadvisor_restart_policy }}"
restart_retries: "{{ cadvisor_restart_retries | default(omit) }}"
state: "{{ item.value.enabled | ternary('started', 'absent') }}"
volumes: "{{ item.value.volumes }}"
with_dict: "{{ cadvisor_services }}"