mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +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
|
- name: Install required packages
|
||||||
package: name={{ item }}
|
package:
|
||||||
state=present
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
with_items:
|
with_items:
|
||||||
- vnstat
|
- vnstat
|
||||||
tags:
|
tags:
|
||||||
- download
|
- download
|
||||||
|
|
||||||
- name: Put the config file in place
|
- name: Put the config file in place
|
||||||
template: src=vnstat.conf.j2
|
template:
|
||||||
dest=/etc/vnstat.conf
|
src: vnstat.conf.j2
|
||||||
mode=0744
|
dest: /etc/vnstat.conf
|
||||||
owner=root
|
mode: 0744
|
||||||
group=root
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
- name: Create database for WAN to collect vnStat data
|
- name: Create database for WAN to collect vnStat data
|
||||||
shell: /usr/bin/vnstat -i {{ iiab_wan_iface }}
|
shell: /usr/bin/vnstat -i {{ iiab_wan_iface }}
|
||||||
|
@ -22,16 +24,20 @@
|
||||||
when: iiab_lan_iface is defined
|
when: iiab_lan_iface is defined
|
||||||
|
|
||||||
- name: Start vnStat daemon via systemd
|
- 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
|
- name: Add 'vnstat' to list of services at /etc/iiab/iiab.ini
|
||||||
ini_file: dest='{{ service_filelist }}'
|
ini_file:
|
||||||
section=vnstat
|
dest: "{{ service_filelist }}"
|
||||||
option='{{ item.option }}'
|
section: vnstat
|
||||||
value='{{ item.value }}'
|
option: "{{ item.option }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
with_items:
|
with_items:
|
||||||
- option: name
|
- option: name
|
||||||
value: vnstat
|
value: vnStat
|
||||||
- option: description
|
- 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)."'
|
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
|
- option: installed
|
||||||
|
|
Loading…
Reference in a new issue