当我这样做时,我遇到了这条消息:
ansible-playbook -i inventory junos_config_new.yml --check -vvv
ansible-playbook 2.9.9 配置文件 = /etc/ansible/ansible.cfg 配置模块搜索路径 = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python模块位置 = /root/.local/lib/python3.6/site-packages/ansible 可执行位置 = /usr/bin/ansible-playbook python 版本 = 3.6.8(默认,2019 年 11 月 21 日,19:31:34) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] 使用 /etc/ansible/ansible。cfg 作为配置文件 host_list 拒绝解析 /home/gefela/ansible_junos/inventory 因为它没有通过它的 verify_file() 方法脚本拒绝解析 /home/gefela/ansible_junos/inventory 因为它没有通过它的 verify_file() 方法自动拒绝解析 / home/gefela/ansible_junos/inventory 因为它没有通过它的 verify_file() 方法使用 ini 插件解析 /home/gefela/ansible_junos/inventory 库存源
剧本:junos_config_new.yml ********************************************* ****************************************************** ****************************** junos_config_new.yml 中播放 1 次
这是我的剧本...
name: Juniper SRX configuration compliance checks
hosts: juniper
gather_facts: false
connection: local
tasks:
- name: Syslog server checks
junos_config:
src: ~/ansible_junos/files/syslog_config.txt
comment: Ensure that appropriate Syslog server configured
register: junos_output
- debug:
var: junos_output
- name: success
debug:
msg: Syslog server check - This check has passed with the following output({{ junos_output }})
when: not junos_output.changed
- name: failed
debug:
msg: Syslog server check - This check has failed with the following output({{ junos_output }})
when: junos_output.changed
- name: Admin credentials check
junos_config:
src: ~/ansible_junos/files/admin_user.txt
comment: Ensure that Admin user havee been created
register: junos_output
- debug:
var: junos_output
- name: success
debug:
msg: Admin credentials check - This check has passed with the following output({{ junos_output }})
when: not junos_output.changed
- name: failed
debug:
msg: Admin credentials check - This check has failed with the following output({{ junos_output }})
when: junos_output.changed
~/ansible_junos/files/syslog_config.txt 目录在正确的位置 ~/ansible_junos/files/ 是否应该是放置所有要与防火墙进行比较的配置的正确位置?
请告诉我 ..