tehtbl.bootstrap
<!-- To find the id, run: ansible-galaxy info tehtbl.bootstrap | grep -i "id:" -->
<a href="https://galaxy.ansible.com/tehtbl/bootstrap"><img src="https://img.shields.io/ansible/role/44496"/></a>
<a href="https://galaxy.ansible.com/tehtbl/bootstrap"><img src="https://img.shields.io/ansible/quality/44496"/></a>
<a href="https://travis-ci.org/tehtbl/ansible-role-bootstrap"><img src="https://travis-ci.org/tehtbl/ansible-role-bootstrap.svg?branch=master" alt="Build status"/></a>
Role Description
================
This role prepares your Debian and Ubuntu systems for use with Ansible.
Example Playbook
================
This example comes from `molecule/default/converge.yml`, and it is tested with every update and release.
```yaml
---
- name: Converge
hosts: all
become: true
gather_facts: false
roles:
- role: tehtbl.bootstrap
Before running this, your machine might need preparation. I use the following playbook to make sure everything is ready for the role to work.
---
- name: Prepare
hosts: all
become: true
gather_facts: false
Role Variables
These variables can be found in defaults/main.yml
:
---
# ------------------------------------------------------------------------
# Default settings for bootstrap
# ------------------------------------------------------------------------
# User to connect to machines
bootstrap_user: root
# Software to support certain modules that are labeled as "preview" (e.g. mysql_db).
# Options are "yes", "no", or leave it unset.
bootstrap_preview: true
# Do you want to wait until the host is ready?
bootstrap_wait_for_host: false
# Wait time in seconds for connection test before it fails
bootstrap_timeout: 3
# Number of retries during installation
bootstrap_retries: 3
Requirements
- You need access to a package repository, likely online.
- You must have a recent version of Ansible. (Tests are run on the latest, previous, and next versions of Ansible.)
Context
This role works with many compatible roles. Check out my other roles for more info.
Compatibility
This role has been tested on these Docker images:
Container | Tag | Allow Failures |
---|---|---|
debian | stable | no |
debian | testing | no |
debian | unstable | yes |
ubuntu | xenial | yes |
ubuntu | bionic | no |
ubuntu | focal | no |
ubuntu | devel | yes |
This role has been tested on these Ansible versions:
- ansible>=2.8, <2.9
- ansible>=2.9
- git+https://github.com/ansible/ansible.git@devel
Testing Using Tox
Unit tests are run on every commit, pull request, release, and regularly.
If you find issues, please report them in GitHub.
Testing is done with Tox and Molecule:
Tox checks multiple Ansible versions, while Molecule checks various distributions.
To test using defaults (any installed Ansible version, namespace: tehtbl
, image: ubuntu
, tag: latest
):
molecule test
# Or choose a specific image:
IMAGE="ubuntu" molecule test
# Or select a specific image and tag:
IMAGE="debian" TAG="stable" tox
You can also test multiple Ansible versions and select the right images:
Tox allows testing with multiple Ansible versions. To run tests with the default settings:
tox
# To test with Ubuntu (namespace: `tehtbl`, tag: `latest`)
IMAGE="ubuntu" tox
# For more customization:
IMAGE="debian" TAG="stable" tox -e py37-ansible-current
Testing Using Vagrant
Install vagrant
plugins by running:
vagrant plugin install vagrant-reload
Start tests using the VirtualBox Provider:
vagrant up
License
MIT License
Author Information
Sources
This work is based on the great contributions of many individuals, such as Robert de Bock, Jeff Geerling, and Thomas Waldmann. Thank you! ```