Commit graph

11 commits

Author SHA1 Message Date
Cody Hill
a753ff7cbf
Fix packet dynamic inventory "Slug" issue. (#63916)
* Fixed 'slug' bug in packet_net.py that was caused by a breaking change in the Packet API.

* Removed some debugging and comments I had left.

* Missed a spot!
2020-02-15 14:58:44 +00:00
Vitaly Shestovskiy
95d4908987
Fix packet.net dynamic inventory projects limit. (#64889)
* Added parameters to list more than 10 projects per run

* Fix slug issue due to packet api change. Same as https://github.com/ansible/ansible/pull/63916
2020-02-15 14:55:40 +00:00
Sam Doran
3cd98a9fcc Use ansible.module_utils.six in inventory scripts (#55000)
* Use six from ansible.module_utils for inventory scripts

Remove skips from sanity test

* Change all imports of ConfigParser to use module_utils.six.moves

* Remove commented out lines

* Fix six imports
2019-04-09 13:17:59 -04:00
Dan Nicholson
3ada56e2b1 Skip non-management Packet IP addresses (#48168)
Non-management (elastic) IP addresses require manual configuration on
the host as described in https://help.packet.net/article/54-elastic-ips.
Skip those so that only the automatically configured management
addresses are used. Otherwise, a non-routable address may be returned in
the inventory.
2018-12-20 12:06:11 +00:00
Matt Martz
c1c229c6d4
Remove use of simplejson throughout code base (#43548)
* Remove use of simplejson throughout code base. Fixes #42761

* Address failing tests

* Remove simplejson from contrib and other outlying files

* Add changelog fragment for simplejson removal
2018-08-10 11:13:29 -05:00
Matt Clay
e45c763b64 Fix invalid string escape sequences. 2017-11-21 10:03:34 -08:00
Tomáš Karásek
a5c41dcd49 Add grouping by hostname for the Packet inventory (#21069)
* Add grouping by hostname for the Packet inventory

* remove space after eol
2017-07-18 09:31:42 -04:00
Matt Martz
d3249e7875 pep8 fixes for contrib (#24344) 2017-05-09 16:38:08 -05:00
Toshio Kuratomi
6bad4e57bd Migrate most uses of if type() to if isinstance()
Also convert those checks to use abcs instead of dict and list.

Make a sentinel class for strategies to report when they've reache the end
2017-04-04 08:17:20 -07:00
Matt Martz
39ea50b731 pep8 fixes for recent packet_net inventory (#21066) 2017-02-06 11:10:58 -05:00
Tomáš Karásek
db8fd95d68 Dynamic inventory for Packet host (https://packet.net) (#20635)
* Add dynamic inventory script and config for Packet.net

* The script and config have been shamelessly cargo
  culted from the `ec2.py` and `ec2.ini` dynamic inventory
  script.
* This is an initial version and could very well be
  enhanced and made better.

Examples:

`PACKET_NET_API_KEY=<MY_AUTH_TOKEN> --list` to get inventory for
all hosts in Packet.net in all projects (defaults to `--list`
if no argument provided).

`PACKET_NET_API_KEY=<MY_AUTH_TOKEN> --host HOST` to get variables
for a single host.

* improvements in Packet host dynamic inventory
2017-02-06 09:56:17 +00:00