Files
security_check/roles/security_check/tasks/create_readme.yml
ByeonJungHun 8681d69fbc update
2024-01-04 16:06:37 +09:00

48 lines
1.2 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: "취약점 {{ check_status.stdout_lines }} 발견"
when: "'nas' in group_names"
- debug:
msg: "취약점 {{ 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: |
pwd
ls -al
git clone https://{{ git_user }}:{{ git_key }}@github.com/CloudMOA/security_check.git
cp ./README.md ./security_check/README.md
cd ./security_check
git add .
git commit -m "검사 결과 업데이트"
git push
delegate_to: 127.0.0.1
when: "'nas' in group_names"
- debug:
msg: "결과 확인 : https://github.com/CloudMOA/security_check.git"
when: "'nas' in group_names"