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

...

parent 21a8b99d
No related branches found
No related tags found
No related merge requests found
eci_users:
- testuser
- testuser2
eci_users_uid:
testuser: 61
testuser2: 62
- hosts: stations
become: True
become_user: adamsmith
tasks:
- name: Update and upgrade system.
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400
- name: Install packages
apt:
name: [ 'nscd',
'curl',
'wget',
'gzip',
'atop',
'git',
'gvfs',
'cifs-utils',
's3fs',
'openjdk-17-jre-headless',
'openjdk-17-jdk-headless' ]
......@@ -25,7 +25,20 @@
path: /etc/dhcp/dhclient.conf
notify: restart-network
- name: Create /eci-users.
ansible.builtin.file:
path: /etc/eci-users
state: directory
mode: '0711'
- name: Create /eci-users/user.
ansible.builtin.file:
path: "/etc/eci-users/{{ item }}"
state: directory
mode: '0711'
loop: "{{ eci_users }}"
- name: Create /etc/eci-platform.
ansible.builtin.file:
path: /etc/eci-platform
......
- name: Restart FTP.
listen: restart-ftp
ansible.builtin.systemd:
state: restarted
name: proftpd
- name: Install packages.
apt:
name: [ "proftpd-basic" ]
- name: Ensure group auth exists.
file:
state: touch
path: /etc/proftpd/ftpd.group
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"
loop: "{{eci_users}}"
notify: restart-ftp
- name: Configure ProFTPd for multiple virtual users.
blockinfile:
path: /etc/proftpd/proftpd.conf
block: |
DefaultRoot ~
RequireValidShell off
AuthUserFile /etc/proftpd/ftpd.passwd
AuthGroupFile /etc/proftpd/ftpd.group
ServerName "{{hostvars[inventory_hostname].ansible_hostname}}"
AuthOrder mod_auth_file.c
notify: restart-ftp
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