Closed NikitaPuglachenko closed 9 months ago
It would be great to keep the JunOS feature like commit confirm to avoid an outage if something wrong with config.
junos internal/junos/netconf.go ...
junos:
provider "junos" { ... commitconfirm = 5 # minutes }
internal/junos/netconf.go:
// netconfCommit commits the configuration. func (sess *Session) netconfCommit(logMessage string, confirmCommit *int) (_warn []error, _err error) { if confirmCommit != nil { confirmReply, confirmErr := sess.netconf.Exec(netconf.RawMethod(fmt.Sprintf(rpcCommitConfirm, confirmCommit, logMessage))) if confirmErr != nil { return []error{}, fmt.Errorf("executing netconf confirm commit: %w", confirmErr) } // If there are errors in the confirm commit, return now. if confirmReply.Errors != nil { warnings := make([]error, 0) for _, m := range confirmReply.Errors { if m.Severity == errorSeverity { return warnings, errors.New(m.Error()) } warnings = append(warnings, errors.New(m.Error())) } return warnings, nil } delay := *confirmCommit - 1 if delay < 0 { delay = 0 } // Wait for confirmCommit - 1 minutes before committing. time.Sleep(time.Duration(delay) * time.Minute) } ...
https://www.juniper.net/documentation/us/en/software/junos/junos-xml-protocol/topics/ref/tag/junos-xml-protocol-commit-configuration.html
Hi đź‘‹
After a few tests, the feature is feasible. I'll take care of adding it.
Description
It would be great to keep the JunOS feature like commit confirm to avoid an outage if something wrong with config.
New or Affected Resource(s)
junos internal/junos/netconf.go ...
Potential Terraform Configuration
junos:
internal/junos/netconf.go:
References
https://www.juniper.net/documentation/us/en/software/junos/junos-xml-protocol/topics/ref/tag/junos-xml-protocol-commit-configuration.html