mschuchard / mschuchard.general / 1.0.1 / module / packer_init Module to manage Packer template and config directory initialization. | "added in version" 1.0.0 of mschuchard.general" Authors: Matthew Schuchard (@mschuchard)mschuchard.general.packer_init (1.0.1) — module
Install with ansible-galaxy collection install mschuchard.general:==1.0.1
collections: - name: mschuchard.general version: 1.0.1
Install all the missing plugins required in a Packer config. Note that Packer does not have a state. This is the first command that should be executed when working with a new or existing template. This command is always safe to run multiple times. Though subsequent runs may give errors, this command will never delete anything.
# initialize directory in /path/to/packer_config_dir - name: Initialize packer directory in /path/to/packer_config_dir mschuchard.general.packer_init: config_dir: /path/to/packer_config_dir
# initialize current directory and upgrade plugins - name: Initialize current packer directory and upgrade plugins mschuchard.general.packer_init: upgrade: true
# initialize directory in /path/to/packer_config_dir and upgrade plugins - name: Initialize packer directory in /path/to/packer_config_dir and upgrade plugins mschuchard.general.packer_init: config_dir: /path/to/packer_config_dir upgrade: true
upgrade: default: false description: Update installed plugins to the latest available version if there is a new higher one. Note that this still considers the version constraint of the config. required: false type: bool config_dir: default: cwd description: Location of the directory containing the Packer config file. required: false type: str
command: description: The raw Packer command executed by Ansible. returned: always sample: packer init -machine-readable /home/packer type: str