changed some fields/keys/attributes and changed references to reflect those changes
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
group: "{{ item[0]['group'] | default(item[0]['username']) }}"
|
group: "{{ item[0]['group'] | default(item[0]['username']) }}"
|
||||||
path: "{{ item[0]['home'] | default('/home/' ~ item[0]['username']) }}/{{ item[1]['username'] }}"
|
path: "{{ item[0]['home'] | default('/home/' ~ item[0]['username']) }}/{{ item[1]['username'] }}"
|
||||||
state: directory
|
state: directory
|
||||||
loop: "{{ hostvars[inventory_hostname]['users'].values() | product(config['proftpd']['vusers'].values()) }}"
|
loop: "{{ hostvars[inventory_hostname]['users'].values() | product(config['proftpd']['users'].values()) }}"
|
||||||
- name: Create ProFTPd FTP public directory for anonymous logins
|
- name: Create ProFTPd FTP public directory for anonymous logins
|
||||||
when: "'ftps' in item.value['services']"
|
when: "'ftps' in item.value['services']"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
owner: root
|
owner: root
|
||||||
path: "{{ item.value }}"
|
path: "{{ item.value }}"
|
||||||
state: touch
|
state: touch
|
||||||
loop: "{{ lookup('ansible.builtin.dict', config['proftpd']['auth_filepaths']) }}"
|
loop: "{{ lookup('ansible.builtin.dict', config['proftpd']['auth_paths']) }}"
|
||||||
- name: Create the virtual users
|
- name: Create the virtual users
|
||||||
when: "not 'caddy' in item.value['services'] and not 'httpd' in item.value['services'] and not 'www-data' in item.value['services'] and not 'http' in item.value['services'] and not 'https' in item.value['services']"
|
when: "not 'caddy' in item.value['services'] and not 'httpd' in item.value['services'] and not 'www-data' in item.value['services'] and not 'http' in item.value['services'] and not 'https' in item.value['services']"
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
@@ -73,14 +73,14 @@
|
|||||||
- ftpasswd
|
- ftpasswd
|
||||||
- --passwd
|
- --passwd
|
||||||
- "--name={{ item.value['username'] }}"
|
- "--name={{ item.value['username'] }}"
|
||||||
- "--uid=$(id -u {{ item.value['id_of'] }})"
|
- "--uid=$(id -u {{ item.value['id'] }})"
|
||||||
- "--gid=$(id -g {{ item.value['gid_of'] }})"
|
- "--gid=$(id -g {{ item.value['gid'] }})"
|
||||||
- "--home={{ hostvars[inventory_hostname]['users']['ftp']['home'] | default('/srv/ftp') }}/{{ item.value['username'] }}"
|
- "--home={{ hostvars[inventory_hostname]['users']['ftp']['home'] | default('/srv/ftp') }}/{{ item.value['username'] }}"
|
||||||
- --shell=/sbin/nologin
|
- --shell=/sbin/nologin
|
||||||
- --file={{ config['proftpd']['auth_filepaths']['users_path'] }}
|
- --file={{ config['proftpd']['auth_paths']['users'] }}
|
||||||
- --stdin
|
- --stdin
|
||||||
stdin: "{{ item.value['password'] }}"
|
stdin: "{{ item.value['password'] }}"
|
||||||
loop: "{{ lookup('ansible.builtin.dict', config['proftpd']['vusers']) }}"
|
loop: "{{ lookup('ansible.builtin.dict', config['proftpd']['users']) }}"
|
||||||
- name: Create the virtual groups of virtual users
|
- name: Create the virtual groups of virtual users
|
||||||
when: "not 'caddy' in item.value['services'] and not 'httpd' in item.value['services'] and not 'www-data' in item.value['services'] and not 'http' in item.value['services'] and not 'https' in item.value['services']"
|
when: "not 'caddy' in item.value['services'] and not 'httpd' in item.value['services'] and not 'www-data' in item.value['services'] and not 'http' in item.value['services'] and not 'https' in item.value['services']"
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
@@ -88,10 +88,10 @@
|
|||||||
- ftpasswd
|
- ftpasswd
|
||||||
- --group
|
- --group
|
||||||
- "--name={{ item.value['username'] }}"
|
- "--name={{ item.value['username'] }}"
|
||||||
- "--gid=$(id -g {{ item.value['gid_of'] }})"
|
- "--gid=$(id -g {{ item.value['gid'] }})"
|
||||||
- "--member={{ item.value['username'] }}"
|
- "--member={{ item.value['username'] }}"
|
||||||
- --file={{ config['proftpd']['auth_filepaths']['groups_path'] }}
|
- --file={{ config['proftpd']['auth_paths']['groups'] }}
|
||||||
loop: "{{ lookup('ansible.builtin.dict', config['proftpd']['vusers']) }}"
|
loop: "{{ lookup('ansible.builtin.dict', config['proftpd']['users']) }}"
|
||||||
# @TODO create tasks in block integrating LDAP users to ProFTPd
|
# @TODO create tasks in block integrating LDAP users to ProFTPd
|
||||||
# - name: Integrate LDAP users into ProFTPd
|
# - name: Integrate LDAP users into ProFTPd
|
||||||
- name: Create ProFTPd FTPS virtual host
|
- name: Create ProFTPd FTPS virtual host
|
||||||
@@ -108,9 +108,9 @@
|
|||||||
validate: proftpd --configtest
|
validate: proftpd --configtest
|
||||||
vars:
|
vars:
|
||||||
ftp_server_name: "{{ config['proftpd']['name'].uppercase() }}'s Archive'"
|
ftp_server_name: "{{ config['proftpd']['name'].uppercase() }}'s Archive'"
|
||||||
allowed_users: "{{ ','.join(list(map(lambda u: u['username'], filter(lambda u: not 'http' in u['services'] and not 'https' in u['services'] and not 'httpd' in u['services'] and not 'caddy' in u['services'] and not 'www-data' in u['services'], config['proftpd']['vusers'].values())))) }}"
|
allowed_users: "{{ ','.join(list(map(lambda u: u['username'], filter(lambda u: not 'http' in u['services'] and not 'https' in u['services'] and not 'httpd' in u['services'] and not 'caddy' in u['services'] and not 'www-data' in u['services'], config['proftpd']['users'].values())))) }}"
|
||||||
anon_root: "{{ map(lambda u: u['home'], filter(lambda u: 'ftps' in u['services'] or 'proftpd' in u['services'], hostvars[inventory_hostname]['users'].values())) | list | random }}/public"
|
anon_root: "{{ map(lambda u: u['home'], filter(lambda u: 'ftps' in u['services'] or 'proftpd' in u['services'], hostvars[inventory_hostname]['users'].values())) | list | random }}/public"
|
||||||
anon_user: "{{ config['proftpd']['vusers']['smuggler']['username'] }}"
|
anon_user: "{{ config['proftpd']['users']['smuggler']['username'] }}"
|
||||||
- name: Set ProFTPd jail in fail2ban
|
- name: Set ProFTPd jail in fail2ban
|
||||||
block:
|
block:
|
||||||
- name: Create fail2ban system configuration directory
|
- name: Create fail2ban system configuration directory
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ rpc-allow-origin-all=true
|
|||||||
rpc-max-request-size=10M
|
rpc-max-request-size=10M
|
||||||
rpc-listen-all=true
|
rpc-listen-all=true
|
||||||
rpc-listen-port=6800
|
rpc-listen-port=6800
|
||||||
rpc-secret={{ config.aria.secret }}
|
rpc-secret={{ config['aria']['api_key'] }}
|
||||||
# rpc-certificate=
|
# rpc-certificate=
|
||||||
# rpc-private-key=
|
# rpc-private-key=
|
||||||
# rpc-secure=true
|
# rpc-secure=true
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
# AuthOrder mod_auth_pam.c mod_auth_unix.c*
|
# AuthOrder mod_auth_pam.c mod_auth_unix.c*
|
||||||
AuthOrder mod_auth_file.c
|
AuthOrder mod_auth_file.c
|
||||||
AuthUserFile {{ config.proftpd.auth_filepaths.users_path }}
|
AuthUserFile {{ config.proftpd.auth_paths.users }}
|
||||||
AuthGroupFile {{ config.proftpd.auth_filepaths.groups_path }}
|
AuthGroupFile {{ config.proftpd.auth_paths.groups }}
|
||||||
AuthFileOptions SyntaxCheck
|
AuthFileOptions SyntaxCheck
|
||||||
|
|
||||||
TLSEngine on
|
TLSEngine on
|
||||||
|
|||||||
@@ -249,16 +249,16 @@ config:
|
|||||||
editor: nvim
|
editor: nvim
|
||||||
proftpd:
|
proftpd:
|
||||||
name: "{{ hostvars[inventory_hostname].fqdn.split('.')[0] }}"
|
name: "{{ hostvars[inventory_hostname].fqdn.split('.')[0] }}"
|
||||||
auth_filepaths:
|
auth_paths:
|
||||||
users_path: /etc/proftpd/ftpd.passwd
|
users: /etc/proftpd/ftpd.passwd
|
||||||
groups_path: /etc/proftpd/ftpd.group
|
groups: /etc/proftpd/ftpd.group
|
||||||
msg:
|
msg:
|
||||||
welcome: "Our head librarians Furcas and Marbas welcome you!"
|
welcome: "Our head librarians Furcas and Marbas welcome you!"
|
||||||
vusers:
|
users:
|
||||||
webmaster:
|
webmaster:
|
||||||
username: webmaster
|
username: webmaster
|
||||||
id_of: "{{ ['caddy', 'www-data'][0] }}"
|
id: "{{ ['caddy', 'www-data'][0] }}"
|
||||||
gid_of: "{{ ['caddy', 'www-data'][0] }}"
|
gid: "{{ ['caddy', 'www-data'][0] }}"
|
||||||
# @TODO create vaulted password for this ProFTPd virtual user
|
# @TODO create vaulted password for this ProFTPd virtual user
|
||||||
password: !vault |
|
password: !vault |
|
||||||
$ANSIBLE_VAULT;1.2;AES256;vps1-webmaster
|
$ANSIBLE_VAULT;1.2;AES256;vps1-webmaster
|
||||||
@@ -270,8 +270,8 @@ config:
|
|||||||
services: [http,https]
|
services: [http,https]
|
||||||
smuggler:
|
smuggler:
|
||||||
username: smuggler
|
username: smuggler
|
||||||
id_of: "{{ hostvars[inventory_hostname].users.ftp.username }}"
|
id: "{{ hostvars[inventory_hostname].users.ftp.username }}"
|
||||||
gid_of: "{{ hostvars[inventory_hostname].users.ftp.group | default(hostvars[inventory_hostname].users.ftp.username) }}"
|
gid: "{{ hostvars[inventory_hostname].users.ftp.group | default(hostvars[inventory_hostname].users.ftp.username) }}"
|
||||||
# @TODO create vaulted password for this ProFTPd virtual user
|
# @TODO create vaulted password for this ProFTPd virtual user
|
||||||
password: !vault |
|
password: !vault |
|
||||||
$ANSIBLE_VAULT;1.2;AES256;vps1-smuggler
|
$ANSIBLE_VAULT;1.2;AES256;vps1-smuggler
|
||||||
@@ -293,5 +293,5 @@ config:
|
|||||||
phone_region: US
|
phone_region: US
|
||||||
aria:
|
aria:
|
||||||
checksum: ~
|
checksum: ~
|
||||||
secret: ~
|
api_key: ~
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user