From 9e4807b3ada7e14108d2084acdfa74c09e0cfaf6 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Tue, 27 Oct 2015 09:40:36 -0500 Subject: [PATCH] Fixing vsftpd install check Closes-bug: 1510566 Change-Id: Ibc5552466abd75dfd38bf6f305a64cbfa737f634 --- tasks/auth.yml | 35 ----------------------------------- tasks/misc.yml | 39 ++++++++++++++++++++++++++++++++------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/tasks/auth.yml b/tasks/auth.yml index 65d75ea0..f3c4d6e8 100644 --- a/tasks/auth.yml +++ b/tasks/auth.yml @@ -247,41 +247,6 @@ - cat2 - V-38457 -- name: Check if vsftpd installed (for V-38599) - shell: dpkg --status vsftpd - register: v38599_result - changed_when: False - failed_when: False - tags: - - auth - - cat2 - - V-38599 - -- name: Copy login banner (for V-38599) - copy: - src: login_banner.txt - dest: /etc/issue.net - when: v38599_result.rc == 0 - notify: - - restart vsftpd - tags: - - auth - - cat2 - - V-38599 - -- name: V-38599 - Set warning banner for FTPS/FTP logins - lineinfile: - dest: /etc/vsftpd/vsftpd.conf - regexp: "^(#)?banner_file" - line: "banner_file=/etc/issue.net" - when: v38599_result.rc == 0 - notify: - - restart vsftpd - tags: - - auth - - cat2 - - V-38599 - - name: V-38681 - Check for missing GID's in /etc/group shell: "pwck -r | grep 'no group'" register: v38681_result diff --git a/tasks/misc.yml b/tasks/misc.yml index d1a0c145..abe750b0 100644 --- a/tasks/misc.yml +++ b/tasks/misc.yml @@ -161,21 +161,46 @@ - cat3 - V-38684 -- name: Check if vsftpd is installed (for V-38702) - stat: - path: /etc/vsftpd.conf - register: v38702_result +- name: Check if vsftpd installed (for V-38599 and V-38702) + shell: "dpkg --status vsftpd | grep \"^Status:.*ok installed\"" + register: v38599_result changed_when: False + failed_when: False tags: + - cat2 - cat3 + - V-38599 - V-38702 +- name: Copy login banner (for V-38599) + copy: + src: login_banner.txt + dest: /etc/issue.net + when: v38599_result.rc == 0 + notify: + - restart vsftpd + tags: + - cat2 + - V-38599 + +- name: V-38599 - Set warning banner for FTPS/FTP logins + lineinfile: + dest: /etc/vsftpd/vsftpd.conf + regexp: "^(#)?banner_file" + line: "banner_file=/etc/issue.net" + when: v38599_result.rc == 0 + notify: + - restart vsftpd + tags: + - cat2 + - V-38599 + - name: V-38702 - Enable xferlog lineinfile: dest: /etc/vsftpd.conf regexp: "^(#)?xferlog_enable" line: "xferlog_enable=YES" - when: v38702_result.stat.exists == True + when: v38599_result.rc == 0 notify: - restart vsftpd tags: @@ -187,7 +212,7 @@ dest: /etc/vsftpd.conf regexp: "^(#)?xferlog_std_format" line: "xferlog_std_format=NO" - when: v38702_result.stat.exists == True + when: v38599_result.rc == 0 notify: - restart vsftpd tags: @@ -199,7 +224,7 @@ dest: /etc/vsftpd.conf regexp: "^(#)?log_ftp_protocol" line: "log_ftp_protocol=YES" - when: v38702_result.stat.exists == True + when: v38599_result.rc == 0 notify: - restart vsftpd tags: