Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (43 sloc) 1.47 KB
# This playbook install ntop (http://www.ntop.org/).
#
# Copyright (c) 2013 Fabian Affolter <fabian@affolter-engineering.ch>
#
# Licensed under CC BY 3.0. All rights reserved.
#
---
- name: install needed packages
yum: pkg=$item
state=present
with_items:
- GeoIP
- name: install ntopng
command: /usr/sbin/rpm -ihv http://www.nmon.net/packages/rpm/x86_64/ntopng/ntopng-1.0.1_6661-6661.x86_64.rpm
- name: put a dummy file in the share
template: src=files/default.j2
dest=/opt/samba/info.txt
mode=0644
- name: set selinux boolean
command: /usr/sbin/setsebool -P allow_smbd_anon_write=1
- name: allow full access (r/w)
command: /usr/sbin/setsebool -P samba_export_all_rw on
- name: set selinux context
command: /usr/bin/chcon -t samba_share_t /opt/samba/
- name: add a share
lineinfile: dest=/etc/samba/smb.conf
regexp=''
insertafter=EOF
line='[samba]\n\tpath = /opt/samba/\n\tread only = no\n;\tbrowseable = yes\n'
- name: configure firewall, allow samba traffic
command: /usr/bin/firewall-cmd --permanent --add-service=samba
- name: configure firewall, allow samba traffic
command: /usr/bin/firewall-cmd --permanent --add-service=samba-client
- name: reload firewall configuration
command: /usr/bin/firewall-cmd --reload
- name: start samba
service: name=smb
state=running
enabled=yes
- name: start named
service: name=nmb
state=running
enabled=yes