create role psacct
This commit is contained in:
parent
9357facb7d
commit
7ffafeb09f
1 changed files with 36 additions and 0 deletions
36
roles/psacct/tasks/main.yml
Normal file
36
roles/psacct/tasks/main.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
- block:
|
||||
- name: install psacct package
|
||||
package:
|
||||
name: psacct
|
||||
state: installed
|
||||
|
||||
- name: enable psacct service
|
||||
service:
|
||||
name: psacct
|
||||
enabled: true
|
||||
state: started
|
||||
when: ansible_system == "Linux"
|
||||
|
||||
- block:
|
||||
- name: create /var/account
|
||||
file:
|
||||
state: directory
|
||||
path: /var/account
|
||||
mode: 0750
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: turn on accounting
|
||||
shell: touch /var/account/acct && accton /var/account/acct
|
||||
args:
|
||||
creates: /var/account/acct
|
||||
warn: no
|
||||
|
||||
- name: enable accounting service
|
||||
service:
|
||||
name: accounting
|
||||
enabled: yes
|
||||
when: ansible_system == "OpenBSD"
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue