Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/canhanhan/packer-template
Ansible role for creating Packer templates
https://github.com/canhanhan/packer-template
Last synced: about 1 month ago
JSON representation
Ansible role for creating Packer templates
- Host: GitHub
- URL: https://github.com/canhanhan/packer-template
- Owner: canhanhan
- License: mit
- Created: 2018-10-12T17:33:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-27T21:27:52.000Z (almost 6 years ago)
- Last Synced: 2023-10-21T11:19:05.594Z (about 1 year ago)
- Language: Python
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
packer-template
=========Ansible role to generate Packer templates using YAML and Jinja2.
Due to limitations of JSON, Packer templates contain a lot of code duplication. Flexibility of YAML and Jinja2, helps to reduce the duplication.
Requirements
------------No requirements for executing the module.
### Testing Requirements
Molecule and docker are required for testing. On Debian/Ubuntu based system you can install using:```bash
sudo pip install moleculecurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
sudo apt update
sudo apt install -y docker-ce
sudo pip install docker-py
```### WSL and Docker
If you are using WSL and Docker on a VM, modify the docker config to have TCP listener enabled:```bash
sudo systemctl edit docker
#[Service]
#ExecStart=
#ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375
```On WSL, configure the host settings for Docker client:
```bash
DOCKER_HOST=127.0.0.1:2375
export DOCKER_HOST
```molecule --base-config molecule/base.yml check
Role Variables
--------------`packer_name`: Name for the template.
`packer_dest`: Target directory to create Packer template(s), additional file(s) and folder(s).
`packer_os_type`: OS family. Currently ony excepted value is `windows`.
`packer_options`: A dictionary/hashtable for packer template options.
- `image`: (Optional|String) Image type. If provided, the role with read default settings from image configuration.
- `builders`: (Optional|Dictionary) Packer builders
- `provisioners`: (Optional|List) Packer provisioners
- `variables`: (Optional|Dictionary) Packer variables
- `sensitive-variables`: (Optional|List) Packer sensitive variables arrayExample Playbook
----------------Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }License
-------MIT