implement role
This commit is contained in:
parent
58c5aea839
commit
699b5ed523
@ -1,2 +1,13 @@
|
|||||||
---
|
---
|
||||||
# defaults file for ansible-role-vsftpd
|
# defaults file for ansible-role-vsftpd
|
||||||
|
vsftpd_service_state: "started"
|
||||||
|
vsftpd_service_enabled: true
|
||||||
|
|
||||||
|
|
||||||
|
vsftpd_enable_ssl: false
|
||||||
|
vsftpd_cert_file: ssl-cert.pem
|
||||||
|
vsftpd_key_file: ssl-cert.key
|
||||||
|
# config variables
|
||||||
|
vsftpd_config: {}
|
||||||
|
|
||||||
|
vsftpd_sssd: true
|
||||||
|
@ -1,2 +1,10 @@
|
|||||||
---
|
---
|
||||||
# handlers file for ansible-role-vsftpd
|
# handlers file for ansible-role-vsftpd
|
||||||
|
- name: restart vsftpd
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: vsftpd
|
||||||
|
state: restarted
|
||||||
|
when: vsftpd_service_state != 'stopped'
|
||||||
|
become: true
|
||||||
|
# Ignore errors due to: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754762;msg=9
|
||||||
|
ignore_errors: yes
|
||||||
|
@ -1,2 +1,35 @@
|
|||||||
---
|
---
|
||||||
# tasks file for ansible-role-vsftpd
|
# tasks file for ansible-role-vsftpd
|
||||||
|
|
||||||
|
- name: Installing packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "{{ vsftpd_package }}"
|
||||||
|
state: present
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Configuring vsftp
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "vsftpd.j2"
|
||||||
|
dest: "{{ vsftpd_config_template_path }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
become: true
|
||||||
|
notify: restart vsftpd
|
||||||
|
|
||||||
|
- name: Configuring service
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: vsftpd
|
||||||
|
state: "{{ vsftpd_service_state }}"
|
||||||
|
enabled: "{{ vsftpd_service_enabled }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Configure pam for sssd
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "pam.d/vsftpd.j2"
|
||||||
|
dest: "/etc/pam.d/vsftpd"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
become: true
|
||||||
|
when: vsftpd_sssd == true
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: all
|
||||||
remote_user: root
|
|
||||||
roles:
|
roles:
|
||||||
- ansible-role-vsftpd
|
- ansible-role-vsftpd
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
---
|
---
|
||||||
# vars file for ansible-role-vsftpd
|
# vars file for ansible-role-vsftpd
|
||||||
|
vsftpd_package: vsftpd
|
||||||
|
vsftpd_config_template_path: "/etc/vsftpd.conf"
|
||||||
|
Loading…
Reference in New Issue
Block a user