bolt 2.35.0 → 2.40.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Puppetfile +1 -1
- data/bolt-modules/boltlib/lib/puppet/datatypes/applyresult.rb +1 -0
- data/lib/bolt/analytics.rb +27 -8
- data/lib/bolt/apply_result.rb +3 -3
- data/lib/bolt/bolt_option_parser.rb +45 -18
- data/lib/bolt/cli.rb +92 -110
- data/lib/bolt/config.rb +184 -80
- data/lib/bolt/config/options.rb +144 -83
- data/lib/bolt/config/transport/base.rb +10 -19
- data/lib/bolt/config/transport/local.rb +1 -7
- data/lib/bolt/config/transport/options.rb +11 -68
- data/lib/bolt/config/transport/ssh.rb +8 -19
- data/lib/bolt/executor.rb +5 -17
- data/lib/bolt/inventory.rb +25 -0
- data/lib/bolt/inventory/group.rb +0 -8
- data/lib/bolt/inventory/options.rb +130 -0
- data/lib/bolt/inventory/target.rb +10 -11
- data/lib/bolt/module_installer.rb +21 -13
- data/lib/bolt/module_installer/resolver.rb +1 -1
- data/lib/bolt/outputter.rb +19 -5
- data/lib/bolt/outputter/human.rb +20 -1
- data/lib/bolt/outputter/json.rb +1 -1
- data/lib/bolt/outputter/logger.rb +1 -1
- data/lib/bolt/outputter/rainbow.rb +13 -2
- data/lib/bolt/plugin.rb +41 -12
- data/lib/bolt/plugin/cache.rb +76 -0
- data/lib/bolt/plugin/module.rb +4 -4
- data/lib/bolt/plugin/puppetdb.rb +1 -1
- data/lib/bolt/project.rb +59 -40
- data/lib/bolt/project_manager.rb +201 -0
- data/lib/bolt/{project_migrator/config.rb → project_manager/config_migrator.rb} +49 -4
- data/lib/bolt/{project_migrator/inventory.rb → project_manager/inventory_migrator.rb} +3 -3
- data/lib/bolt/{project_migrator/base.rb → project_manager/migrator.rb} +2 -2
- data/lib/bolt/{project_migrator/modules.rb → project_manager/module_migrator.rb} +5 -3
- data/lib/bolt/puppetdb/client.rb +8 -0
- data/lib/bolt/puppetdb/config.rb +1 -2
- data/lib/bolt/rerun.rb +1 -5
- data/lib/bolt/shell/bash.rb +8 -2
- data/lib/bolt/shell/powershell.rb +21 -3
- data/lib/bolt/target.rb +4 -0
- data/lib/bolt/task/run.rb +1 -1
- data/lib/bolt/transport/local.rb +13 -0
- data/lib/bolt/transport/ssh/exec_connection.rb +6 -2
- data/lib/bolt/util.rb +36 -7
- data/lib/bolt/validator.rb +227 -0
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_server/base_config.rb +3 -1
- data/lib/bolt_server/config.rb +3 -1
- data/lib/bolt_server/plugin.rb +13 -0
- data/lib/bolt_server/plugin/puppet_connect_data.rb +37 -0
- data/lib/bolt_server/schemas/connect-data.json +22 -0
- data/lib/bolt_server/schemas/partials/task.json +3 -3
- data/lib/bolt_server/transport_app.rb +68 -40
- data/libexec/apply_catalog.rb +1 -1
- data/libexec/custom_facts.rb +1 -1
- data/libexec/query_resources.rb +1 -1
- metadata +23 -17
- data/lib/bolt/project_migrator.rb +0 -80
@@ -1,80 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bolt/project_migrator/config'
|
4
|
-
require 'bolt/project_migrator/inventory'
|
5
|
-
require 'bolt/project_migrator/modules'
|
6
|
-
|
7
|
-
module Bolt
|
8
|
-
class ProjectMigrator
|
9
|
-
def initialize(config, outputter)
|
10
|
-
@config = config
|
11
|
-
@outputter = outputter
|
12
|
-
end
|
13
|
-
|
14
|
-
def migrate
|
15
|
-
unless $stdin.tty?
|
16
|
-
raise Bolt::Error.new(
|
17
|
-
"stdin is not a tty, unable to migrate project",
|
18
|
-
'bolt/stdin-not-a-tty-error'
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
@outputter.print_message("Migrating project #{@config.project.path}\n\n")
|
23
|
-
|
24
|
-
@outputter.print_action_step(
|
25
|
-
"Migrating a Bolt project may make irreversible changes to the project's "\
|
26
|
-
"configuration and inventory files. Before continuing, make sure the "\
|
27
|
-
"project has a backup or uses a version control system."
|
28
|
-
)
|
29
|
-
|
30
|
-
return 0 unless Bolt::Util.prompt_yes_no("Continue with project migration?", @outputter)
|
31
|
-
|
32
|
-
@outputter.print_message('')
|
33
|
-
|
34
|
-
ok = migrate_inventory && migrate_config && migrate_modules
|
35
|
-
|
36
|
-
if ok
|
37
|
-
@outputter.print_message("Project successfully migrated")
|
38
|
-
else
|
39
|
-
@outputter.print_error("Project could not be migrated completely")
|
40
|
-
end
|
41
|
-
|
42
|
-
ok ? 0 : 1
|
43
|
-
end
|
44
|
-
|
45
|
-
# Migrates the project-level configuration file to the latest version.
|
46
|
-
#
|
47
|
-
private def migrate_config
|
48
|
-
migrator = Bolt::ProjectMigrator::Config.new(@outputter)
|
49
|
-
|
50
|
-
migrator.migrate(
|
51
|
-
@config.project.config_file,
|
52
|
-
@config.project.project_file,
|
53
|
-
@config.inventoryfile || @config.project.inventory_file,
|
54
|
-
@config.project.backup_dir
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
|
-
# Migrates the inventory file to the latest version.
|
59
|
-
#
|
60
|
-
private def migrate_inventory
|
61
|
-
migrator = Bolt::ProjectMigrator::Inventory.new(@outputter)
|
62
|
-
|
63
|
-
migrator.migrate(
|
64
|
-
@config.inventoryfile || @config.project.inventory_file,
|
65
|
-
@config.project.backup_dir
|
66
|
-
)
|
67
|
-
end
|
68
|
-
|
69
|
-
# Migrates the project's modules to use current best practices.
|
70
|
-
#
|
71
|
-
private def migrate_modules
|
72
|
-
migrator = Bolt::ProjectMigrator::Modules.new(@outputter)
|
73
|
-
|
74
|
-
migrator.migrate(
|
75
|
-
@config.project,
|
76
|
-
@config.modulepath
|
77
|
-
)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|