0
스크립트를 실행할 때 "ERROR! 필드 '호스트가 필요하지만 설정되지 않았습니다."가 계속 발생합니다. 아무도 내가 실종 됐다는 것을 말해 줄 수 있습니까? 저는 현재 2 centos 6 가상 머신에 DISA stig 강화를 구현하려고합니다.내 스크립트를 실행할 때 계속
---
- name: Stig implementation
hosts: Database
tasks:
- name: upgrade all packages
command: yum upgrade -y
- name: update all packages
command: yum update -y
- name: /etc/passd file is owned by root
command: chown root:root /etc/passwd
- name: remove rsh-server package
command: yum erase rsh-server
- name: bootload configuration owner is root
command: chgrp root /etc/grub.conf
- name: rshd service disabled
command: chkconfig rsh off
- name: rexecd service disabled
command: chkconfig rexec off
- name: remove telnet and telnet-server
command: yum erase telnet-server && yum erase telnet
- lineinfile: dest=/etc/ssh/sshd_config
state=present
regexp='PermitEmptyPasswords'
line='PermitEmptyPasswords no'
backup=yes
- lineinfile: dest=/etc/ssh/sshd_config
state=present
regexp='HostbasedAuthentication'
line='HostbasedAuthentication no'
backup=yes
- name: Change etc/group ownership
command: chgrp root /etc/group
- name: operating system must connect to external networks
command: chkconfig ip6tables on && service ip6tables start
- name: add lines
lineinfile: dest=/etc/audit/audit.rules
line='{{item}}'
with_items:
- '-w /sbin/insmod -p x -k modules'
- '-w /sbin/rmmod -p x -k modules'
- '-w /sbin/modprobe -p x -k modules'
- '-a always,exit -F arch=[b64] -S init_module -S delete_module -k modules'
- name: disable xinetd
command: chkconfig xinetd off && service xinetd stop
- name: turn off and disable netconsole
command: chkconfig netconsole off && service netconsole stop
나는이 가정 내 호스트 파일
[localhost]
x.x.x.x
[Database]
x.x.x.x
x.x.x.x
오류 - 어떤 선이 발생합니까? 전체 출력을 게시 할 수 있습니까? –
또한, 옆에 나열된 명령 중에는 yum과 같은 동등한 명령이 이미 있습니다. –
작업 패딩을 확인하십시오. 어쩌면 하나의 작업이 실수로 연극이되었을 수도 있습니다. 그리고 위의 주석에 언급 된 바와 같이 많은 명령은 가능한 네이티브 모듈로 대체되어야합니다. –