44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
---
|
|
- name: check status [1]
|
|
shell: |
|
|
grep -H '☆ 취약 개수 = [1-9]' *.txt | cut -d: -f1
|
|
args:
|
|
chdir: /volume1/platform/05_Security_check/
|
|
register: check_status
|
|
when: "'nas' in group_names"
|
|
|
|
- name: check status [2]
|
|
shell: |
|
|
grep -H '☆ 취약 개수 = [0]' *.txt | cut -d: -f1
|
|
args:
|
|
chdir: /volume1/platform/05_Security_check/
|
|
register: check_ok
|
|
when: "'nas' in group_names"
|
|
|
|
- debug:
|
|
msg: "취약점 {{ item }} 발견"
|
|
loop: "{{ check_status.stdout_lines }}"
|
|
when: "'nas' in group_names"
|
|
|
|
- debug:
|
|
msg: "취약점 {{ item }} 양호"
|
|
loop: "{{ check_ok.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"
|
|
|
|
- name: git push
|
|
shell: |
|
|
git add .
|
|
git commit -m "README.md Update"
|
|
git push
|
|
delegate_to: 127.0.0.1
|
|
when: "'nas' in group_names"
|
|
|
|
- debug:
|
|
msg: "결과 확인 : https://github.com/CloudMOA/security_check.git" |