Skip to content

Conversation

@adreyer
Copy link

@adreyer adreyer commented Nov 2, 2018

This shows how tasks can be updated to use the "remote" transport in bolt with credentials stored in inventory instead of passing credentials as params to the task. It also enables running a task to target multiple devices concurrently.

nodes:

  - name: nm011qhwxyni6zt.delivery.puppetlabs.net
  - name: pzwsffj7lq4sce1.delivery.puppetlabs.net
    config:
      transport: remote
      remote:
        # it's hard to use the local transport with bundle exec but normally this could be skipped to let it default to localhost
        run-on: nm011qhwxyni6zt.delivery.puppetlabs.net
        type: panos
        user: "admin"
        password: "admin"

@codecov
Copy link

codecov bot commented Nov 2, 2018

Codecov Report

Merging #70 into master will decrease coverage by 0.12%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
- Coverage     100%   99.87%   -0.13%     
==========================================
  Files          36       36              
  Lines         813      815       +2     
==========================================
+ Hits          813      814       +1     
- Misses          0        1       +1
Impacted Files Coverage Δ
lib/puppet/util/network_device/panos/device.rb 99.45% <50%> (-0.55%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf86cb4...a442d96. Read the comment docs.

}
}
},
"files": [ "panos/lib/puppet/util/network_device/panos/device.rb" ]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures the device is copied to the target so the module does not need to be installed in /etc/puppetlabs/code. The puppet-resource_api gem is still required though.

require 'json'
require 'puppet/util/network_device/panos/device'

def add_plugin_paths(install_dir)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the type of logic I think we can pull out into a helper. The generic ruby task helper probably should add "lib" from any modules to the loadpath anyway.

@DavidS
Copy link
Contributor

DavidS commented Mar 14, 2019

Superseded by #73

@DavidS DavidS closed this Mar 14, 2019
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

Successfully merging this pull request may close these issues.

2 participants