On 3/9/20 4:36 PM, gefela wrote:
> 
> 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  

I have no clue about Juniper and the junos_config module, but it might be worth 
to run with -vvvv to see where
Ansible looks for the file.

Regards
        Racke

> 
> 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] 
> <mailto:[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
> <https://groups.google.com/d/msgid/ansible-project/605b2514-739a-4281-93da-f4f437b368a8%40googlegroups.com?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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/887f2651-793a-d073-17cc-37a6f86396dc%40linuxia.de.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to