foreman_netbox 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/app/interactors/foreman_netbox/concerns/assign_tags.rb +21 -0
  4. data/app/interactors/foreman_netbox/sync_host/sync_device/create.rb +3 -1
  5. data/app/interactors/foreman_netbox/sync_host/sync_device/organizer.rb +1 -0
  6. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/create.rb +2 -1
  7. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/update.rb +2 -2
  8. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/create.rb +3 -1
  9. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/create.rb +6 -1
  10. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/delete.rb +1 -1
  11. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/update.rb +2 -14
  12. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/update.rb +2 -3
  13. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_site/create.rb +4 -1
  14. data/app/interactors/foreman_netbox/sync_host/sync_device/sync_site/update.rb +3 -9
  15. data/app/interactors/foreman_netbox/sync_host/sync_device/update.rb +3 -7
  16. data/app/interactors/foreman_netbox/sync_host/sync_tags/create.rb +30 -0
  17. data/app/interactors/foreman_netbox/sync_host/sync_tags/find.rb +26 -0
  18. data/app/interactors/foreman_netbox/sync_host/sync_tags/organizer.rb +22 -0
  19. data/app/interactors/foreman_netbox/sync_host/sync_tenant/create.rb +4 -1
  20. data/app/interactors/foreman_netbox/sync_host/sync_tenant/update.rb +3 -9
  21. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/create.rb +3 -1
  22. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/organizer.rb +1 -0
  23. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/create.rb +3 -1
  24. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/update.rb +3 -9
  25. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/create.rb +6 -1
  26. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/create.rb +7 -2
  27. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/delete.rb +1 -1
  28. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/update.rb +2 -14
  29. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/update.rb +2 -3
  30. data/app/interactors/foreman_netbox/sync_host/sync_virtual_machine/update.rb +3 -7
  31. data/app/models/concerns/foreman_netbox/user_usergroup_common_extensions.rb +1 -1
  32. data/app/models/orchestration/netbox.rb +3 -0
  33. data/app/services/foreman_netbox/cached_netbox_parameters.rb +8 -8
  34. data/app/services/foreman_netbox/netbox_parameters.rb +8 -17
  35. data/app/services/foreman_netbox/netbox_parameters_comparator.rb +2 -2
  36. data/lib/foreman_netbox/version.rb +1 -1
  37. data/test/integration/foreman_netbox/sync_k8s_physical_host_test.rb +12 -8
  38. data/test/integration/foreman_netbox/sync_rhel_physical_host_test.rb +12 -8
  39. data/test/integration/foreman_netbox/sync_rhel_virtual_host_test.rb +12 -8
  40. data/test/interactors/foreman_netbox/sync_host/organizer_test.rb +18 -2
  41. data/test/interactors/foreman_netbox/sync_host/sync_device/create_test.rb +5 -3
  42. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/create_test.rb +4 -3
  43. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/update_test.rb +8 -3
  44. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/create_test.rb +8 -4
  45. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/create_test.rb +10 -5
  46. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/delete_test.rb +2 -2
  47. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/update_test.rb +5 -3
  48. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/update_test.rb +7 -5
  49. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_site/create_test.rb +2 -2
  50. data/test/interactors/foreman_netbox/sync_host/sync_device/sync_site/update_test.rb +4 -3
  51. data/test/interactors/foreman_netbox/sync_host/sync_device/update_test.rb +19 -5
  52. data/test/interactors/foreman_netbox/sync_host/sync_tenant/create_test.rb +2 -2
  53. data/test/interactors/foreman_netbox/sync_host/sync_tenant/update_test.rb +5 -3
  54. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/create_test.rb +4 -3
  55. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/create_test.rb +7 -3
  56. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/update_test.rb +5 -3
  57. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/create_test.rb +5 -4
  58. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/create_test.rb +9 -7
  59. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/delete_test.rb +2 -2
  60. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/update_test.rb +13 -4
  61. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/update_test.rb +9 -4
  62. data/test/interactors/foreman_netbox/sync_host/sync_virtual_machine/update_test.rb +7 -4
  63. data/test/models/foreman_netbox/usergroup_test.rb +4 -4
  64. data/test/services/foreman_netbox/netbox_attributes_test.rb +10 -19
  65. data/test/services/foreman_netbox/netbox_parameters_comparator_test.rb +6 -16
  66. data/test/test_plugin_helper.rb +15 -3
  67. metadata +127 -53
metadata CHANGED
@@ -1,15 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_netbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dmTECH GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-16 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dry-configurable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.12.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.12.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: dry-container
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.7.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: dry-core
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.6.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: dry-inflector
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: dry-schema
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.6.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.6.0
13
83
  - !ruby/object:Gem::Dependency
14
84
  name: dry-validation
15
85
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +114,14 @@ dependencies:
44
114
  requirements:
45
115
  - - "~>"
46
116
  - !ruby/object:Gem::Version
47
- version: 0.5.1
117
+ version: 0.5.5
48
118
  type: :runtime
49
119
  prerelease: false
50
120
  version_requirements: !ruby/object:Gem::Requirement
51
121
  requirements:
52
122
  - - "~>"
53
123
  - !ruby/object:Gem::Version
54
- version: 0.5.1
124
+ version: 0.5.5
55
125
  - !ruby/object:Gem::Dependency
56
126
  name: rdoc
57
127
  requirement: !ruby/object:Gem::Requirement
@@ -109,6 +179,7 @@ files:
109
179
  - app/contracts/foreman_netbox/params/ip_address_params.rb
110
180
  - app/contracts/foreman_netbox/params/tenant_params.rb
111
181
  - app/contracts/foreman_netbox/virtual_machine_contract.rb
182
+ - app/interactors/foreman_netbox/concerns/assign_tags.rb
112
183
  - app/interactors/foreman_netbox/concerns/facts.rb
113
184
  - app/interactors/foreman_netbox/concerns/primary_ips.rb
114
185
  - app/interactors/foreman_netbox/delete_host/delete_device.rb
@@ -145,6 +216,9 @@ files:
145
216
  - app/interactors/foreman_netbox/sync_host/sync_device/sync_site/update.rb
146
217
  - app/interactors/foreman_netbox/sync_host/sync_device/update.rb
147
218
  - app/interactors/foreman_netbox/sync_host/sync_device/validate.rb
219
+ - app/interactors/foreman_netbox/sync_host/sync_tags/create.rb
220
+ - app/interactors/foreman_netbox/sync_host/sync_tags/find.rb
221
+ - app/interactors/foreman_netbox/sync_host/sync_tags/organizer.rb
148
222
  - app/interactors/foreman_netbox/sync_host/sync_tenant/create.rb
149
223
  - app/interactors/foreman_netbox/sync_host/sync_tenant/find.rb
150
224
  - app/interactors/foreman_netbox/sync_host/sync_tenant/organizer.rb
@@ -274,70 +348,70 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
348
  - !ruby/object:Gem::Version
275
349
  version: '0'
276
350
  requirements: []
277
- rubygems_version: 3.1.2
351
+ rubygems_version: 3.3.3
278
352
  signing_key:
279
353
  specification_version: 4
280
354
  summary: Adds integration with NetBox
281
355
  test_files:
282
- - test/integration/foreman_netbox/sync_rhel_physical_host_test.rb
283
- - test/integration/foreman_netbox/sync_rhel_virtual_host_test.rb
284
- - test/integration/foreman_netbox/sync_k8s_physical_host_test.rb
285
- - test/models/host/managed_test.rb
286
- - test/models/foreman_netbox/location_test.rb
287
- - test/models/foreman_netbox/nics/base_test.rb
288
- - test/models/foreman_netbox/usergroup_test.rb
289
- - test/models/foreman_netbox/netbox_facet_test.rb
290
356
  - test/factories/host.rb
291
357
  - test/factories/netbox_facet.rb
292
- - test/fixtures/netbox_virtual_machine_raw_data.json
293
- - test/fixtures/netbox_device_raw_data.json
358
+ - test/fixtures/facts/k8s_physical_host.json
294
359
  - test/fixtures/facts/rhel_physical_host.json
295
360
  - test/fixtures/facts/rhel_virtual_host.json
296
- - test/fixtures/facts/k8s_physical_host.json
297
- - test/test_plugin_helper.rb
298
- - test/jobs/foreman_netbox/sync_host_job_test.rb
299
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/find_test.rb
300
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/update_test.rb
301
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/create_test.rb
302
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/sync_cluster_type/find_test.rb
303
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/sync_cluster_type/create_test.rb
304
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/find_test.rb
305
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/update_test.rb
306
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/delete_test.rb
307
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/find_test.rb
308
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/update_test.rb
309
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/create_test.rb
310
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/delete_test.rb
311
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/find_test.rb
312
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/update_test.rb
313
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/create_test.rb
314
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/create_test.rb
315
- - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/save_netbox_url_test.rb
316
- - test/interactors/foreman_netbox/sync_host/sync_tenant/find_test.rb
317
- - test/interactors/foreman_netbox/sync_host/sync_tenant/update_test.rb
318
- - test/interactors/foreman_netbox/sync_host/sync_tenant/create_test.rb
361
+ - test/fixtures/netbox_device_raw_data.json
362
+ - test/fixtures/netbox_virtual_machine_raw_data.json
363
+ - test/integration/foreman_netbox/sync_k8s_physical_host_test.rb
364
+ - test/integration/foreman_netbox/sync_rhel_physical_host_test.rb
365
+ - test/integration/foreman_netbox/sync_rhel_virtual_host_test.rb
319
366
  - test/interactors/foreman_netbox/sync_host/organizer_test.rb
320
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_site/find_test.rb
321
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_site/update_test.rb
322
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_site/create_test.rb
367
+ - test/interactors/foreman_netbox/sync_host/sync_device/create_test.rb
323
368
  - test/interactors/foreman_netbox/sync_host/sync_device/find_test.rb
324
- - test/interactors/foreman_netbox/sync_host/sync_device/update_test.rb
369
+ - test/interactors/foreman_netbox/sync_host/sync_device/save_netbox_url_test.rb
370
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/create_test.rb
371
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/find_test.rb
372
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/create_test.rb
325
373
  - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/find_test.rb
326
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/update_test.rb
327
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/sync_manufacturer/find_test.rb
328
374
  - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/sync_manufacturer/create_test.rb
329
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/create_test.rb
375
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/sync_manufacturer/find_test.rb
376
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_type/update_test.rb
377
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/create_test.rb
378
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/delete_test.rb
379
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/find_test.rb
380
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/create_test.rb
330
381
  - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/delete_test.rb
331
382
  - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/find_test.rb
332
383
  - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/update_test.rb
333
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/sync_ip_addresses/create_test.rb
334
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/delete_test.rb
335
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/find_test.rb
336
384
  - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/update_test.rb
337
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_interfaces/create_test.rb
338
- - test/interactors/foreman_netbox/sync_host/sync_device/create_test.rb
339
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/find_test.rb
340
- - test/interactors/foreman_netbox/sync_host/sync_device/sync_device_role/create_test.rb
341
- - test/interactors/foreman_netbox/sync_host/sync_device/save_netbox_url_test.rb
385
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_site/create_test.rb
386
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_site/find_test.rb
387
+ - test/interactors/foreman_netbox/sync_host/sync_device/sync_site/update_test.rb
388
+ - test/interactors/foreman_netbox/sync_host/sync_device/update_test.rb
389
+ - test/interactors/foreman_netbox/sync_host/sync_tenant/create_test.rb
390
+ - test/interactors/foreman_netbox/sync_host/sync_tenant/find_test.rb
391
+ - test/interactors/foreman_netbox/sync_host/sync_tenant/update_test.rb
392
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/create_test.rb
393
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/find_test.rb
394
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/save_netbox_url_test.rb
395
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/create_test.rb
396
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/find_test.rb
397
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/sync_cluster_type/create_test.rb
398
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/sync_cluster_type/find_test.rb
399
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_cluster/update_test.rb
400
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/create_test.rb
401
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/delete_test.rb
402
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/find_test.rb
403
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/create_test.rb
404
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/delete_test.rb
405
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/find_test.rb
406
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/sync_ip_addresses/update_test.rb
407
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/sync_interfaces/update_test.rb
408
+ - test/interactors/foreman_netbox/sync_host/sync_virtual_machine/update_test.rb
409
+ - test/jobs/foreman_netbox/sync_host_job_test.rb
410
+ - test/models/foreman_netbox/location_test.rb
411
+ - test/models/foreman_netbox/netbox_facet_test.rb
412
+ - test/models/foreman_netbox/nics/base_test.rb
413
+ - test/models/foreman_netbox/usergroup_test.rb
414
+ - test/models/host/managed_test.rb
342
415
  - test/services/foreman_netbox/netbox_attributes_test.rb
343
416
  - test/services/foreman_netbox/netbox_parameters_comparator_test.rb
417
+ - test/test_plugin_helper.rb