mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 19:22:24 +00:00
Update main.yml
This commit is contained in:
parent
2bc4a04173
commit
5fd7397c0d
1 changed files with 20 additions and 14 deletions
|
@ -1,18 +1,20 @@
|
|||
---
|
||||
- name: Install required packages
|
||||
package: name={{ item }}
|
||||
state=present
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- vnstat
|
||||
tags:
|
||||
- download
|
||||
|
||||
- name: Put the config file in place
|
||||
template: src=vnstat.conf.j2
|
||||
dest=/etc/vnstat.conf
|
||||
mode=0744
|
||||
owner=root
|
||||
group=root
|
||||
template:
|
||||
src: vnstat.conf.j2
|
||||
dest: /etc/vnstat.conf
|
||||
mode: 0744
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Create database for WAN to collect vnStat data
|
||||
shell: /usr/bin/vnstat -i {{ iiab_wan_iface }}
|
||||
|
@ -22,16 +24,20 @@
|
|||
when: iiab_lan_iface is defined
|
||||
|
||||
- name: Start vnStat daemon via systemd
|
||||
service: name=vnstat enabled=yes state=started
|
||||
service:
|
||||
name: vnstat
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
- name: Add vnStat to service list
|
||||
ini_file: dest='{{ service_filelist }}'
|
||||
section=vnstat
|
||||
option='{{ item.option }}'
|
||||
value='{{ item.value }}'
|
||||
- name: Add 'vnstat' to list of services at /etc/iiab/iiab.ini
|
||||
ini_file:
|
||||
dest: "{{ service_filelist }}"
|
||||
section: vnstat
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: name
|
||||
value: vnstat
|
||||
value: vnStat
|
||||
- option: description
|
||||
value: '"vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s)."'
|
||||
- option: installed
|
||||
|
|
Loading…
Reference in a new issue