Ansible Role: vsftp
配置ftp服務(wù)端
介紹
vsftpd 是“very secure FTP daemon”的縮寫,安全性是它的一個(gè)最大的特點(diǎn)。vsftpd 是一個(gè) UNIX 類操作系統(tǒng)上運(yùn)行的服務(wù)器的名字,它可以運(yùn)行在諸如 Linux、BSD、Solaris、 HP-UNIX等系統(tǒng)上面,是一個(gè)完全免費(fèi)的、開放源代碼的ftp服務(wù)器軟件,支持很多其他的 FTP 服務(wù)器所不支持的特征。
要求
此角色僅在RHEL及其衍生產(chǎn)品上運(yùn)行。
測(cè)試環(huán)境
ansible 2.3.0.0
os Centos 6.7 X64
python 2.6.6
角色變量
vsftpd_packages:
- vsftpd
- libsemanage-python
- libselinux-python
- pam
- db4-utils
vsftpd_listen_port: 21
vsftpd_data_port: 20
vsftpd_pasv_min_port: 30000
vsftpd_pasv_max_port: 31000
vsftpd_local_umask: '022'
vsftpd_share_path: '/ftp_share'
vsftpd_banner: "Welcome to Ftp Server!"
vsftpd_syslog_enable: false
vsftpd_log_file: '/var/log/vsftpd.log'
vsftpd_xferlog_file: '/var/log/xferlog'
vsftpd_options: ""
# vsftpd_options: |
# max_per_ip: 5
# max_clients: 100
vsftpd_anon: true
vsftpd_local_users: []
# vsftpd_users:
# - name: alice
# password: "ecila"
# home: /ftp_alice
vsftpd_vusers: []
# vsftpd_vusers:
# - name: alice
# password: ecila
# local_root: '/alice_share'
# conf: |
# local_umask=011
vsftpd_userfile: "/etc/vsftpd/vuser"
vsftpd_userdb: "/etc/vsftpd/vuser.db"
vsftpd_userconf: "/etc/vsftpd/vuser_conf"
依賴
None
github地址
https://github.com/kuailemy123/Ansible-roles/tree/master/vsftpd
Example Playbook
# 默認(rèn)配置,匿名登錄
- hosts: node1
roles:
- role: vsftpd
# 本地用戶登錄
- hosts: node1
vars:
- vsftpd_local_users:
- name: alice
password: "123"
home: /ftp_alice
- name: lili
password: "123"
roles:
- vsftpd
# 虛擬用戶登錄
- hosts: node1
vars:
- vsftpd_share_path: '/ftp_vuser_share'
- vsftpd_vusers:
- name: test1
password: 123
- name: test2
password: 123
local_root: '/ftp_test2_home'
conf: |
local_root=/ftp_test2_home
local_umask=011
roles:
- vsftpd
端口
- 21
- 20
使用
~]# service vsftpd
Usage: /etc/init.d/vsftpd {start|stop|restart|try-restart|force-reload|status}