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: ...@@ -3,6 +3,5 @@ eci_users:
- testuser2 - testuser2
eci_users_uid: eci_users_uid:
testuser: 61 testuser: 61
testuser2: 62 testuser2: 62
...@@ -25,17 +25,28 @@ ...@@ -25,17 +25,28 @@
path: /etc/dhcp/dhclient.conf path: /etc/dhcp/dhclient.conf
notify: restart-network 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. - name: Create /eci-users.
ansible.builtin.file: ansible.builtin.file:
path: /etc/eci-users path: /eci-users
state: directory state: directory
mode: '0711' mode: '0711'
- name: Create /eci-users/user. - name: Create /eci-users/user.
ansible.builtin.file: ansible.builtin.file:
path: "/etc/eci-users/{{ item }}" path: "/eci-users/{{ item }}"
state: directory state: directory
mode: '0711' owner: "{{ eci_users_uid[item] }}"
group: eci
mode: '0771'
loop: "{{ eci_users }}" loop: "{{ eci_users }}"
......
...@@ -9,13 +9,14 @@ ...@@ -9,13 +9,14 @@
mode: 0600 mode: 0600
- name: Create FTP users. - name: Create FTP users.
debug: shell:
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" 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}}" loop: "{{eci_users}}"
notify: restart-ftp notify: restart-ftp
- name: Configure ProFTPd for multiple virtual users. - name: Configure ProFTPd for multiple virtual users.
tags: proftpd-conf-text
blockinfile: blockinfile:
path: /etc/proftpd/proftpd.conf path: /etc/proftpd/proftpd.conf
block: | 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