0

I am runnning into this message when I do this :

ansible-playbook -i inventory junos_config_new.yml --check -vvv

ansible-playbook 2.9.9 config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /root/.local/lib/python3.6/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 3.6.8 (default, Nov 21 2019, 19:31:34) [GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] Using /etc/ansible/ansible.cfg as config file host_list declined parsing /home/gefela/ansible_junos/inventory as it did not pass its verify_file() method script declined parsing /home/gefela/ansible_junos/inventory as it did not pass its verify_file() method auto declined parsing /home/gefela/ansible_junos/inventory as it did not pass its verify_file() method Parsed /home/gefela/ansible_junos/inventory inventory source with ini plugin

PLAYBOOK: junos_config_new.yml ***************************************************************************************************************************** 1 plays in junos_config_new.yml

This is the playbook that I have ...

        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 

The directory ~/ansible_junos/files/syslog_config.txt is in the right place

My question is ; should ~/ansible_junos/files/ be the right place to place all the configuration to be compared against the firewall .

Please let me know ..

1 Answer 1

0

I am guessing that the junos_config module doesn't do ~ expansion.

Can you try with the full path to the file.. Presumably

- name: name: Syslog server checks 
  junos_config:
    src: /home/gefela/ansible_junos/files/syslog_config.txt
4
  • I have tried that but it does not work
    – user409817
    Commented Jun 13, 2020 at 13:42
  • can you paste the error output
    – Tom
    Commented Jun 14, 2020 at 15:25
  • I have managed to resolve this by defining ansible_user and ansible_password
    – user409817
    Commented Jun 20, 2020 at 13:10
  • @user409817, please add an answer with the solution that worked for you... Commented Nov 22, 2021 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .