-
Notifications
You must be signed in to change notification settings - Fork 0
/
sftp.yml
51 lines (42 loc) · 1.31 KB
/
sftp.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
- hosts: all
remote_user: root
vars:
main_nodes_ips: "{% set IP_ARR=[] %}{% for host in groups['all'] %}{% if IP_ARR.insert(loop.index,hostvars[host]['ansible_default_ipv4']['address']) %}{% endif %}{% endfor %}{{IP_ARR|join(' ')}}"
main_nodes_ipc: "{% set IP_ARR=[] %}{% for host in groups['all'] %}{% if IP_ARR.insert(loop.index,hostvars[host]['ansible_default_ipv4']['address']) %}{% endif %}{% endfor %}{{IP_ARR|join(',')}}"
ipv4_master_addr: "{{ hostvars[groups['all'][0]]['ansible_default_ipv4']['address'] }}"
vars_files:
- "{{ var_file }}"
tasks:
- name: update apt
apt: update_cache=yes
- name: ensure proftpd is installed
apt: pkg=proftpd state=latest
- name: deploy proftpd.conf
copy:
src: files/proftpd/proftpd.conf
dest: /etc/proftpd/proftpd.conf
owner: root
group: root
mode: 0644
- name: create identity files
file:
path: /etc/proftpd/{{ item }}
state: touch
owner: root
group: root
mode: 0600
with_items:
- ftpd.passwd
- ftpd.group
- name: create authorized keys directory
file:
path: /etc/proftpd/authorized_keys.d
state: directory
owner: root
group: root
mode: 0755
- name: restart proftpd
service:
name: proftpd
state: restarted