Skip to content

Glances Container

Auto Documentation

Documentation Generated with Python on 2021-04-03

Default Variables

Tasks

main.yml

- name: Ensures Glances directory dir exists
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  loop:
    - "{{ docker_dir }}/glances"

- name: Copy Template Config file
  template:
    src: "roles/glances_container/templates/glances_config.j2"
    dest: "{{ docker_dir }}/glances/glances.conf"

- name: "[Docker] Create Glances Container"
  docker_container:
    name: glances
    image: nicolargo/glances:latest
    network_mode: host
    pid_mode: host
    restart_policy: unless-stopped
    # published_ports:
    #   - 61208:61208
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "{{ docker_dir }}/glances/glances.conf:/glances/conf/glances.conf"
    env:
      GLANCES_OPT: "-w"
      # GLANCES_OPT: "-q --export influxdb"