Introducing Bolt 2.0

See more posts about: Product

We released Bolt 1.0 just over a year ago, and since then we've seen the number of regular Bolt users quadruple! Since 1.0, we've been focused on making Bolt more extensible and stabilizing the APIs needed to write more complex and powerful plans. Today, we're excited to announce that the Bolt project has reached its next major milestone: Bolt 2.0. In this post, we highlight some of the features we've been working on, and fill you in on what's next.

Inventory plugins

We introduced a new Bolt inventory file format, known as inventory V2, which supports loading information through plugins. Using a V2 inventory plugin, you can load secrets from external sources, discover targets in dynamic environments, and customize the behavior of certain plan functions. Bolt ships with plugins to support Vault, Terraform, AWS, Azure, and to encrypt secrets directly in the inventory file. We've added the bolt inventory show command to make it easier to debug these dynamic inventory files. For more information, see Using plugins.

The following inventory file loads targets from two different Terraform projects into a single Bolt inventory:

1
2
3
4
5
6
7
8
9
10
11
12
13
groups:
  - name: cloud-webs
    targets:
      - _plugin: terraform
        dir: /path/to/terraform/project1
        resource_type: google_compute_instance.web
        target_mapping:
          uri: network_interface.0.access_config.0.nat_ip
      - _plugin: terraform
        dir: /path/to/terraform/project2
        resource_type: aws_instance.web
        target_mapping:
          uri: public_ip

Remote targets

Bolt is now able to run tasks that execute on a proxy target. This makes it easy to write tasks that interact with network devices, cloud APIs, or any target with a limited execution environment. For more information, see Writing remote tasks.

Target API

We've worked to make the API for target objects in the plan language more consistent and powerful. This makes it easier to discover or create targets in a plan or connect to the same target through multiple transports.

With the new API, it's possible to set config values directly on targets in a plan or create entirely new targets with the same data format as the inventory file. You can finally create targets where the name does not include the hostname or password -- the most exciting innovation since Uh-Oh! Oreos.

1
2
3
4
5
6
7
8
9
10
11
  $opts_hash = {
                'name' => 'readable name',
                'config' => {
                  'transport' => 'ssh',
                  'ssh' => {
                    'host' => '192.168.4.12',
                    'password' => 'hunter2'
                  }
                }
              }
  $with_opts = Target.new($opts_hash)

For more information, see Target objects.

Migration path

We expect upgrading to Bolt 2.0 to be relatively painless. However, there are a small number of deprecations and breaking changes. Where possible, we've built functionality into the 1.x series to make this transition easier. Users can test their plans with the future configuration option in version 1.49.0. We have written the bolt project migrate command to help convert version 1 inventory files to version 2. The Bolt team does not intend to make any more releases in the 1.x series of Bolt and we encourage users to upgrade as soon as possible. For more information on migrating, see Upgrading to Bolt 2.0.

What’s next

For the last few months, we've been heavily focused on stabilizing APIs for the 2.0 release. With Bolt 2.0 released to the wild, our top priority is removing roadblocks for new Bolt users and expanding the ability of plan authors to leverage Puppet's resource abstraction layer.

Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.