Junos Space Developer
Junos Space Developer

Configlet to delete a service

‎09-12-2019 06:19 AM

I want to run this configlet to delete the service ssh for root-login allow.

Tried several itterations of the command in this configlet to make it work, and it still fails.

I can do it manually, and it works, but I have well over 100 switches to apply this to.

Can someone show me where I am wrong:

 

IP Address:	10.11.9.225
Device name:	UC-TEST-SWITCH
Entity name:	UC-TEST-SWITCH
Apply configlet status:	Failed
Applied Params Details:
No params applicable
Applied Configuration:
<configuration-text xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" type="subtree"> system {
service {
delete: ssh root-login allow ;
}
}
</configuration-text>
Job Failure Reason:
<rpc-reply >
<rpc-error>
<error-type>protocol</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-message>syntax error</error-message>
<error-info>
<bad-element>service</bad-element>
</error-info>
</rpc-error>
<rpc-error>
<error-type>protocol</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-message>error recovery ignores input until this point</error-message>
<error-info>
<bad-element>}</bad-element>
</error-info>
</rpc-error>
<rpc-error>
<error-severity>warning</error-severity>
<error-path>[edit]</error-path>
<error-message>mgd: statement has no contents; ignored</error-message>
<error-info>
<bad-element>system</bad-element>
</error-info>
</rpc-error>
</rpc-reply>
  system {
  service  {
 delete: ssh root-login allow ;
    }
  }
JNCIA-Junos
2 REPLIES 2
Junos Space Developer

Re: Configlet to delete a service

‎09-12-2019 06:26 AM
Hello ,

I will request and suggest you to create a Device Quick Template : https://www.juniper.net/documentation/en_US/junos-space17.2/platform/topics/task/configuration/devic...

Add the CLI command as :
delete system services ssh root-login allow

And Save and Assign/Deploy the template to multiple switches at once.
Checked in lab and it works


Thank you,

Regards
Animesh Mohapatra
Regards
-Animesh
If this worked for you please flag my post as an "Accepted Solution" so others can be benefited.
Junos Space Developer
Solution
Accepted by topic author starlog
‎09-12-2019 10:03 AM

Re: Configlet to delete a service

‎09-12-2019 07:57 AM

Hi, 

 

Also validated with Configlet and it works.

The correct config in the configlet will be : 

 

delete: system services ssh root-login allow ;

 


 
  • Validation Success

 

 

Regards
-Animesh
If this worked for you please flag my post as an "Accepted Solution" so others can be benefited.