Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for dynamic command execution based on cumulus version #3353

Open
sukhmeetbawa opened this issue Dec 19, 2024 · 0 comments
Open

Support for dynamic command execution based on cumulus version #3353

sukhmeetbawa opened this issue Dec 19, 2024 · 0 comments

Comments

@sukhmeetbawa
Copy link

I am trying to make a model file for cumulus where, different commands are executed based on the cumulus version whether net command is available or nv command is available.

cmd 'cat /etc/cumulus/etc.replace/os-release' do |cfg|
    @cumulus_version = cfg.match(/^VERSION_ID=(\d+)\./)[1]
    cfg = add_comment('VERSION') + cfg
  end

this it is the code for that in the model file. The problem is @cumulus_version value is not being read in the following model file. something like this

if @cumulus_version == '4'
  cmd 'net show lldp' do |cfg|
    cfg = add_comment('LLDP') + cfg
  end
end

I want to know if this is even possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant