manala.proftpd
#######################################################################################################
:exclamation: 废弃通知 :exclamation:
此仓库及其关联的角色已被废弃,推荐使用 Manala Ansible Collection
你可以在 集合仓库 中找到使用信息
#######################################################################################################
Ansible 角色: ProFTPd 
:exclamation: 请在 主 Ansible 角色仓库 中 报告问题 和 提交拉取请求 :exclamation:
该角色负责设置 ProFTPd。
它是 Manala Ansible 堆栈的一部分,但也可以作为独立组件使用。
要求
无。
依赖
无。
安装
Ansible 2+
使用 ansible galaxy 命令行工具:
ansible-galaxy install manala.proftpd
使用 ansible galaxy 需求文件:
- src: manala.proftpd
角色处理器
名称 | 类型 | 描述 |
---|---|---|
proftpd restart |
服务 | 重启 proftpd 服务器 |
角色变量
名称 | 默认值 | 类型 | 描述 |
---|---|---|---|
manala_proftpd_install_packages |
~ | 数组 | 要安装的依赖包 |
manala_proftpd_install_packages_default |
['proftpd-basic'] | 数组 | 默认要安装的依赖包 |
manala_proftpd_configs_exclusive |
false | 布尔 | 配置的独占性 |
manala_proftpd_configs_dir |
'/etc/proftpd/conf.d' | 字符串 | 配置目录路径 |
manala_proftpd_configs_defaults |
{} | 字符串 | 配置默认值 |
manala_proftpd_configs |
[] | 数组 | 配置 |
manala_proftpd_users_file |
'/etc/ftpd.passwd' | 字符串 | 用户账户定义文件路径 |
manala_proftpd_users_template |
'users/_default.j2' | 字符串 | 用户账户定义模板路径 |
manala_proftpd_users_defaults |
{...} | 数组 | ProFTPd 用户账户默认值 |
manala_proftpd_users |
[] | 数组 | ProFTPd 用户账户 |
配置示例
manala_proftpd_configs
键用于允许你基于所选择的模板格式定义配置。
manala_proftpd_configs_exclusive
允许你清除现有的 ProFTPd 配置文件,清理到 manala_proftpd_configs_dir
键定义的目录中。确保没有旧的或手动创建的文件会影响当前配置。
manala_proftpd_configs_exclusive: true
可以提供状态(present|absent)。
manala_proftpd_configs:
# 基于字典
- file: default.conf
config:
ServerName: Manala
PassivePorts: 10000 10030
DefaultRoot: "~"
AuthOrder: mod_auth_file.c
AuthUserFile: /etc/ftpd.passwd
RequireValidShell: false
# 基于字典的数组(已废弃)
- file: default_deprecated.conf
config:
- ServerName: Manala
- PassivePorts: 10000 10030
- DefaultRoot: "~"
- AuthOrder: mod_auth_file.c
- AuthUserFile: /etc/ftpd.passwd
- RequireValidShell: false
# 基于内容
- file: content.conf
config: |
<Anonymous ~ftp>
User ftp
Group nogroup
</Anonymous>
# 基于模板
- file: template.conf
template: my_proftpd_template.conf.j2
config:
Foo: bar
# 确保配置不存在
- file: absent.conf
state: absent # 默认是 "present"
# 忽略配置
- file: ignore.conf
state: ignore
# 扁平化配置
- "{{ my_custom_configs_array }}"
虚拟主机
你也可以使用虚拟主机配置:
- file: virtual_host_foo.conf
config:
- VirtualHost ftp.foo.com:
- ServerName: Foo FTP Server
- MaxClients: 10
- MaxLoginAttempts: 1
- Limit LOGIN:
- Order: Allow,Deny
- AllowUser: foo
- Deny: from all
- DefaultRoot: "~"
- Directory /srv/ftp/docs:
- Limit ALL:
- DenyAll
用户账户配置
使用 manala_proftpd_users_template
键来定义可以访问 FTP 存储的用户。
manala_proftpd_users_defaults:
uid: 1337 # 将作为默认值应用于用户
gid: 7331
manala_proftpd_users:
- name: manala
password: "$1$KBijsXOEr4"b$9HEyZDLPnSe3SXq0n66oE3y/"
home: /srv/my_dir
shell: /bin/false
- name: toto
password: "$1$9f19dba0ce5ece883b53275dcc1721b9"
home: /home/toto
shell: /bin/false
mode: "0755"
uid: 1000
gid: 1000
我们强烈建议你生成 SHA2 密码哈希。
在 Linux 下,可以使用以下命令生成:
echo -n yourpassword | mkpasswd --method=sha-512 -
示例剧本
- hosts: servers
roles:
- role: manala.proftpd
许可证
MIT
作者信息
Manala (http://www.manala.io/) 是一个开源项目,由法国网络机构 (ELAO) 支持。