Config on the SRX: firefly-perimeter , 12.1X47-D20.7
set system host-name vsrx1
set system root-authentication plain-text
set system services ssh root-login allow
set system services netconf sshset system login user ansible class super-user
set system login user ansible authentication plain-text-passwordset interfaces fxp0 unit 0 family inet address 192.168.0.12/24
set routing-options static route default next-hop 192.168.0.1
set security zones functional-zone management host-inbound-traffic system-services netconf
Netconf test: ( user: root/juniper1 or ansible / ansible1 )
jlk@ubuntu:/etc/ansible$ ssh ansible@vsrx1 -p 830 -s netconf
Password:
<!-- No zombies were killed during the creation of this user interface -->
<!-- user ansible, class j-super-user -->
<hello>
<capabilities>
<capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file</capability>
<capability>http://xml.juniper.net/netconf/junos/1.0</capability>
<capability>http://xml.juniper.net/dmi/system/1.0</capability>
</capabilities>
<session-id>2198</session-id>
</hello>
]]>]]>
ad hoc command:
ansible server -a "whoami" ( server is from the inventory file: hosts )
...