I am trying to run a playbook and the details come from a file but it is
giving me an error message
ansible-playbook -i inventory junos_config.yml
PLAY [Juniper SRX configuration compliance checks]
*****************************
TASK [Syslog server check]
*****************************************************
fatal: [172.16.203.121]: FAILED! => {"msg": "FileNotFoundError(2, 'No such
file or directory')"}
PLAY RECAP
*********************************************************************
172.16.203.121 : ok=0 changed=0 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
This is the yaml file
---
- name: Juniper SRX configuration compliance checks
hosts: juniper
gather_facts: false
tasks:
- name: Syslog server check
junos_config:
src: files/syslog_config
src_format: set
comment: Appropriate Syslog server configured
register: junos_output
- debug:
var: junos_output
- name: print success
debug:
msg: Syslog server check - This check has passed with the following
output({{ junos_output }})
when: not junos_output.changed
- name: print failed
debug:
msg: Syslog server check - This check has failed with the following
output({{ junos_output }})
when: junos_output.changed
- name: Admin credentials
junos_config:
src: files/admin_user
comment: admin user created and confirmed
- name: NTP check
junos_config:
src: files/NTP server
comment: correct NTP server
- name: idle timeout check
junos_config:
src: files/idle timeout
comment: idle timeout confirmed
The structure of syslog file is
cat files/syslog_config
set system syslog archive size 300000
set system syslog archive files 3
set system syslog archive world-readable
set system syslog user * any emergency
set system syslog host 192.168.100.70 any any
set system syslog host 192.168.100.70 interactive-commands any
set system syslog host 192.168.100.70 facility-override local1
set system syslog host 192.168.100.70 log-prefix firewall
set system syslog host 192.168.100.70 source-address "{{ inventory_hostname
}}"
set system syslog host 192.168.100.70 explicit-priority
set system syslog file messages any critical
set system syslog file messages authorization info
set system syslog file default-log-messages structured-data
set system syslog file sessions user info
set system syslog file interactive-commands interactive-commands error
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/605b2514-739a-4281-93da-f4f437b368a8%40googlegroups.com.