test push

This commit is contained in:
ByeonJungHun
2023-12-22 11:09:53 +09:00
commit 9943b627cb
10 changed files with 7559 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
---
# defaults file for security_check

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
---
- include: start.yml

View File

@@ -0,0 +1,60 @@
---
- name: Create Result Directory
file:
path: /resultdir
state: directory
delegate_to: 127.0.0.1
when: "'nas' in group_names"
- name: Old Result File Delete
shell: |
rm -rf /volume1/platform/05_Security_check/*
when: "'nas' in group_names"
- name: Copy Security Check Script
copy:
src: "{{ role_path }}/files/ubuntu.sh"
dest: /tmp/ubuntu.sh
when: ansible_distribution == 'Ubuntu'
- name: Start Security Check Script
shell: |
chdir
bash /tmp/ubuntu.sh
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 }}"
dest: "/resultdir/"
flat: yes
when: ansible_distribution == 'Ubuntu'
- name: Delete Result File
file:
path: "/tmp/{{ result.stdout }}"
state: absent
when: ansible_distribution == 'Ubuntu'
- name: Find Copy File Name
shell: ls -l /resultdir/ | awk 'NR>1 {print $9}'
register: copy_file
delegate_to: 127.0.0.1
when: "'nas' in group_names"
- name: Copy Result File to NAS
copy:
src: "/resultdir/{{ item }}"
dest: /volume1/platform/05_Security_check
with_items: "{{ copy_file.stdout_lines }}"
when: "'nas' in group_names"

View File

@@ -0,0 +1,2 @@
---
# vars file for security_check