hashicorp/vagrant · error · VagrantPlugins::PodmanProvisioner::PodmanError

The Podman post-install provisioner cannot also take a Podma

Error message

The Podman post-install provisioner cannot also take a Podman post-install
provisioner

What it means

Raised by PodmanProvisioner::Config#post_install_provision when the auxiliary provisioner's `options[:type]` equals "podman". Identical guard to the docker provisioner's: the post-install hook is meant for one non-Podman provisioner (typically shell) that runs right after Podman install; nesting a podman provisioner would recurse install/start logic, so the config call aborts immediately.

Source

Thrown at plugins/provisioners/podman/config.rb:23

module VagrantPlugins
  module PodmanProvisioner
    class Config < VagrantPlugins::ContainerProvisioner::Config
      attr_accessor :kubic

      def initialize
        super()
        @kubic = UNSET_VALUE
      end

      def finalize!
        super()
        @kubic = false if @kubic == UNSET_VALUE
      end

      def post_install_provision(name, **options, &block)
        # Abort
        raise PodmanError, :wrong_provisioner if options[:type] == "podman"

        proxy = VagrantPlugins::Kernel_V2::VMConfig.new
        proxy.provision(name, **options, &block)
        @post_install_provisioner = proxy.provisioners.first
      end
    end
  end
end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Use type "shell" (or file/ansible etc.) for post-install work: `p.post_install_provision "setup", type: "shell", inline: "..."`
  2. Put podman settings (images, kubic, etc.) directly on the podman provisioner block instead

Example fix

# Vagrantfile - before
config.vm.provision "podman" do |p|
  p.post_install_provision "extra", type: "podman"
end

# Vagrantfile - after
config.vm.provision "podman" do |p|
  p.images = ["alpine"]
  p.post_install_provision "msg", type: "shell", inline: "echo podman ready"
end
Defensive patterns

Strategy: validation

Validate before calling

# Keep post-install to a shell step
type = "shell"
raise "podman post_install_provision cannot be type podman" if type == "podman"
p.post_install_provision "setup", type: type, inline: "echo ok"

Type guard

def valid_post_install_type?(type)
  !type.nil? && type != "podman"
end

Prevention

When it happens

Trigger: Calling `podman.post_install_provision "name", type: "podman"` in the Vagrantfile's podman provisioner block.

Common situations: Assuming post_install_provision is a generic provisioner list and passing a podman block; porting docker examples and swapping only the type string.

Related errors


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/6c4f8ecd8363a4bb. Report an issue: GitHub.