-
Notifications
You must be signed in to change notification settings - Fork 5
/
ftp.yml
37 lines (31 loc) · 780 Bytes
/
ftp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- hosts: homelab
handlers:
- name: "Restart"
ansible.builtin.service:
name: vsftpd
state: restarted
tasks:
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 600
changed_when: false
- name: "Install FTP"
ansible.builtin.apt:
name: vsftpd
state: present
- name: "Enable FTP service"
ansible.builtin.service:
name: vsftpd
state: started
enabled: true
- name: "Configure FTP"
ansible.builtin.lineinfile:
path: /etc/vsftpd.conf
regex: "{{ item.regex }}"
line: "{{ item.line }}"
loop:
- regex: "^#write_enable=YES$"
line: "write_enable=YES"
notify: Restart