Skip to content
Snippets Groups Projects
Unverified Commit 4e760bf5 authored by Todor Kondic's avatar Todor Kondic
Browse files

Ftp server users, homes and HTTP connection work.

parent 7390f3c2
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,5 @@ eci_users:
- testuser2
eci_users_uid:
testuser: 61
testuser2: 62
testuser: 61
testuser2: 62
......@@ -25,17 +25,28 @@
path: /etc/dhcp/dhclient.conf
notify: restart-network
- name: Create eci group.
ansible.builtin.group:
name: eci
- name: Get eci's GID.
ansible.builtin.getent:
database: group
key: eci
- name: Create /eci-users.
ansible.builtin.file:
path: /etc/eci-users
path: /eci-users
state: directory
mode: '0711'
- name: Create /eci-users/user.
ansible.builtin.file:
path: "/etc/eci-users/{{ item }}"
path: "/eci-users/{{ item }}"
state: directory
mode: '0711'
owner: "{{ eci_users_uid[item] }}"
group: eci
mode: '0771'
loop: "{{ eci_users }}"
......
......@@ -9,13 +9,14 @@
mode: 0600
- name: Create FTP users.
debug:
msg: "echo {{ eci_passwords[item] }}|ftpasswd --passwd --file=/etc/proftpd/ftpd.passwd --name={{item}} --uid={{eci_users_uid[item]}} --home=/udirs/{{item}} --shell=/bin/false --stdin"
shell:
cmd: "echo {{ eci_passwords[item] }}|ftpasswd --passwd --file=/etc/proftpd/ftpd.passwd --name={{ item }} --uid={{ eci_users_uid[item] }} --gid={{ ansible_facts.getent_group['eci'][1] }} --home=/eci-users/{{item}} --shell=/bin/false --stdin"
loop: "{{eci_users}}"
notify: restart-ftp
- name: Configure ProFTPd for multiple virtual users.
tags: proftpd-conf-text
blockinfile:
path: /etc/proftpd/proftpd.conf
block: |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment