35 lines
834 B
YAML
35 lines
834 B
YAML
---
|
|
- name: Create Glances config directory
|
|
ansible.builtin.file:
|
|
path: /etc/glances
|
|
state: directory
|
|
mode: "0755"
|
|
become: true
|
|
|
|
- name: Write Glances config
|
|
ansible.builtin.copy:
|
|
dest: /etc/glances/glances.conf
|
|
content: |
|
|
[fs]
|
|
hide=/etc/.*,/boot.*
|
|
mode: "0644"
|
|
become: true
|
|
notify: Restart Glances container
|
|
|
|
- name: Run Glances container
|
|
community.docker.docker_container:
|
|
name: glances
|
|
image: nicolargo/glances:latest-full
|
|
state: started
|
|
restart_policy: unless-stopped
|
|
pid_mode: host
|
|
network_mode: host
|
|
privileged: true
|
|
env:
|
|
GLANCES_OPT: "-w --config /etc/glances/glances.conf"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
- /proc:/proc:ro
|
|
- /sys:/sys:ro
|
|
- /mnt:/mnt:ro
|
|
- /etc/glances:/etc/glances:ro |