task 추가
This commit is contained in:
BIN
roles/security_check/.DS_Store
vendored
BIN
roles/security_check/.DS_Store
vendored
Binary file not shown.
@@ -8,5 +8,12 @@
|
||||
when: "'nas' in group_names"
|
||||
|
||||
- debug:
|
||||
msg: "{{ check_status.stdout_lines }}"
|
||||
msg: "취약점 {{ check_status.stdout_lines }} 발견"
|
||||
when: "'nas' in group_names"
|
||||
|
||||
- name: Create README.md
|
||||
template:
|
||||
src: README.md.j2
|
||||
dest: "{{ playbook_dir }}/README.md"
|
||||
delegate_to: 127.0.0.1
|
||||
when: "'nas' in group_names"
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
- name: Create Result Directory
|
||||
file:
|
||||
path: /resultdir
|
||||
path: ~/checklist/
|
||||
state: directory
|
||||
become: false
|
||||
delegate_to: 127.0.0.1
|
||||
when: "'nas' in group_names"
|
||||
|
||||
@@ -27,7 +28,7 @@
|
||||
- name: Copy Result File to Local
|
||||
fetch:
|
||||
src: "/tmp/{{ ansible_hostname }}.txt"
|
||||
dest: "/resultdir/"
|
||||
dest: "~/checklist/"
|
||||
flat: yes
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
@@ -38,21 +39,27 @@
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: Find Copy File Name
|
||||
shell: ls -l /resultdir/ | awk 'NR>1 {print $9}'
|
||||
shell: ls -l ~/checklist/ | awk 'NR>1 {print $9}'
|
||||
register: copy_file
|
||||
become: false
|
||||
delegate_to: 127.0.0.1
|
||||
when: "'nas' in group_names"
|
||||
|
||||
- debug:
|
||||
msg: "파일 {{ copy_file.stdout_lines }} 발견"
|
||||
when: "'nas' in group_names"
|
||||
|
||||
- name: Copy Result File to NAS
|
||||
copy:
|
||||
src: "/resultdir/{{ item }}"
|
||||
src: "~/checklist/{{ item }}"
|
||||
dest: /volume1/platform/05_Security_check
|
||||
with_items: "{{ copy_file.stdout_lines }}"
|
||||
when: "'nas' in group_names"
|
||||
|
||||
- name: Delete Result File
|
||||
file:
|
||||
path: "/resultdir"
|
||||
path: "~/checklist/"
|
||||
state: absent
|
||||
become: false
|
||||
delegate_to: 127.0.0.1
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
@@ -0,0 +1,5 @@
|
||||
|이름|상태 요약|상세 보기|
|
||||
|---|---|---|
|
||||
{% for filename in check_status.stdout_lines %}
|
||||
|{{ filename|splitext|first }}|취약|http://10.10.43.42:8080/{{ filename }}|
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user