test
This commit is contained in:
BIN
roles/security_check/.DS_Store
vendored
Normal file
BIN
roles/security_check/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
resultfile="/tmp/$(hostname)_$(date '+%F-%H:%M').txt"
|
||||
resultfile="/tmp/$(hostname).txt"
|
||||
|
||||
U_01() {
|
||||
echo "" >> $resultfile 2>&1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
resultfile="/tmp/$(hostname)_$(date '+%F-%H:%M').txt"
|
||||
resultfile="/tmp/$(hostname).txt"
|
||||
|
||||
U_01() {
|
||||
echo "" >> $resultfile 2>&1
|
||||
|
||||
12
roles/security_check/tasks/create_readme.yml
Normal file
12
roles/security_check/tasks/create_readme.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: check status
|
||||
shell: |
|
||||
grep -H '☆ 취약 개수 = [1-9]' *.txt | cut -d: -f1
|
||||
args:
|
||||
chdir: /volume1/platform/05_Security_check/
|
||||
register: check_status
|
||||
when: "'nas' in group_names"
|
||||
|
||||
- debug:
|
||||
msg: "{{ check_status.stdout_lines }}"
|
||||
when: "'nas' in group_names"
|
||||
@@ -1,2 +1,4 @@
|
||||
---
|
||||
- include: start.yml
|
||||
|
||||
- include: create_readme.yml
|
||||
|
||||
@@ -24,24 +24,16 @@
|
||||
rm -rf /tmp/ubuntu.sh
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: File Name Search
|
||||
shell: |
|
||||
ls |grep {{ ansible_hostname }}
|
||||
register: result
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
args:
|
||||
chdir: /tmp/
|
||||
|
||||
- name: Copy Result File to Local
|
||||
fetch:
|
||||
src: "/tmp/{{ result.stdout }}"
|
||||
src: "/tmp/{{ ansible_hostname }}.txt"
|
||||
dest: "/resultdir/"
|
||||
flat: yes
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: Delete Result File
|
||||
file:
|
||||
path: "/tmp/{{ result.stdout }}"
|
||||
path: "/tmp/{{ ansible_hostname }}.txt"
|
||||
state: absent
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
@@ -57,4 +49,10 @@
|
||||
dest: /volume1/platform/05_Security_check
|
||||
with_items: "{{ copy_file.stdout_lines }}"
|
||||
when: "'nas' in group_names"
|
||||
|
||||
|
||||
- name: Delete Result File
|
||||
file:
|
||||
path: "/resultdir"
|
||||
state: absent
|
||||
delegate_to: 127.0.0.1
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
0
roles/security_check/templates/README.md.j2
Normal file
0
roles/security_check/templates/README.md.j2
Normal file
Reference in New Issue
Block a user