Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stephrobert/ansible-role-bootstrap

Prepare your system to be managed by Ansible
https://github.com/stephrobert/ansible-role-bootstrap

Last synced: 2 months ago
JSON representation

Prepare your system to be managed by Ansible

Awesome Lists containing this project

README

        

# stephrobert.bootstrap

[![Maintainer](https://img.shields.io/badge/maintained%20by-stephrobert-e00000?style=flat-square)](https://github.com/stephrobert)
[![License](https://img.shields.io/github/license/stephrobert/ansible-role-bootstrap?style=flat-square)](https://github.com/stephrobert/ansible-role-bootstrap/blob/main/LICENSE)
[![Release](https://img.shields.io/github/v/release/stephrobert/ansible-role-bootstrap?style=flat-square)](https://github.com/stephrobert/ansible-role-bootstrap/releases)
[![Status](https://img.shields.io/github/workflow/status/stephrobert/ansible-role-bootstrap/Ansible%20Molecule?style=flat-square&label=tests)](https://github.com/stephrobert/ansible-role-bootstrap/actions?query=workflow%3A%22Ansible+Molecule%22)
[![Ansible Galaxy](https://img.shields.io/badge/ansible-galaxy-black.svg?style=flat-square&logo=ansible)](https://galaxy.ansible.com/stephrobert/bootstrap)[![Ansible version](https://img.shields.io/badge/ansible-%3E%3D2.10-black.svg?style=flat-square&logo=ansible)](https://github.com/ansible/ansible)

⭐ Star us on GitHub — it motivates us a lot!

Prepare your system to be managed by Ansible.

**Platforms Supported**:

| Platform | Versions |
|----------|----------|
| Fedora | 35, 36 |
| Ubuntu | jammy |
| Debian | bullseye |

## ⚠️ Requirements

Ansible >= 2.12.

### Ansible role dependencies

None.

## ⚡ Installation

### Install with Ansible Galaxy

```shell
ansible-galaxy install stephrobert.bootstrap
```

### Install with git

If you do not want a global installation, clone it into your `roles_path`.

```bash
git clone [email protected]:stephrobert/ansible-role-bootstrap.git stephrobert.bootstrap
```

But I often add it as a submodule in a given `playbook_dir` repository.

```bash
git submodule add [email protected]:stephrobert/ansible-role-bootstrap.git roles/stephrobert.bootstrap
```

As the role is not managed by Ansible Galaxy, you do not have to specify the
github user account.

### ✏️ Example Playbook

Basic usage is:

```yaml
- hosts: all
roles:
- role: stephrobert.bootstrap
vars:
bootstrap_timeout: 10

```

## ⚙️ Role Variables

Variables are divided in three types.

The **default vars** section shows you which variables you may
override in your ansible inventory. As a matter of fact, all variables should
be defined there for explicitness, ease of documentation as well as overall
role manageability.

The **context variables** are shown in section below hint you
on how runtime context may affects role execution.

### Default variables

#### main

Bootsrap a machine for Ansible.

| Variable Name | Required | Type | Default | Elements | Description |
|---------------|----------|------|---------|----------|-------------|
| bootstrap_timeout | False | int | 10 | | Time (in seconds) to wait for connection. |

### Context variables

Those variables from `vars/*.{yml,json}` are loaded dynamically during task
runtime using the `include_vars` module.

Variables loaded from `vars/main.yml`.

| Variable Name | Value |
|---------------|-------|
| bootstrap_os_family_map | Alpine:
- Alpine
Archlinux:
- Archlinux
- Antergos
- Manjaro
Debian:
- Debian
- Ubuntu
- Raspbian
- Neon
- KDE neon
- Linux Mint
- SteamOS
- Devuan
- Kali
- Cumulus Linux
- Pop!_OS
- Parrot
- Pardus GNU/Linux
Gentoo:
- Gentoo
- Funtoo
RedHat:
- RedHat
- Fedora
- CentOS
- Scientific
- SLC
- Ascendos
- CloudLinux
- PSBM
- Rocky
- OracleLinux
- OVS
- OEL
- Amazon
- Virtuozzo
- XenServer
- Alibaba
- EulerOS
- openEuler
- AlmaLinux
Suse:
- SLED
- openSUSE Tumbleweed
- openSUSE Leap
- SLES_SAP
- SUSE_LINUX
- SLES
- openSUSE
- SuSE
|
| bootstrap_install | {{ _bootstrap_install[bootstrap_distribution ~'_'~ bootstrap_distribution_major_version] \|default( _bootstrap_install[bootstrap_distribution] ) \|default( _bootstrap_install[bootstrap_os_family] ) }} |
| _bootstrap_install | Alpine:
raw: LANG=C apk update ; apk add {{ bootstrap_packages }}
stdout_regex: Installing
Archlinux:
raw: LANG=C pacman -Sy --noconfirm {{ bootstrap_packages }}
stdout_regex: ' installing python'
Debian:
raw: LANG=C apt-get update && apt-get install -y {{ bootstrap_packages }}
stdout_regex: ' 0 newly installed'
Gentoo:
raw: LANG=C equery l {{ bootstrap_packages }} \| \| (emaint -a sync ; emerge -qkv {{
bootstrap_packages }} ; echo 'changed')
stdout_regex: changed
RedHat:
raw: LANG=C yum -y install {{ bootstrap_packages }}
stdout_regex: Nothing
Suse:
raw: LANG=C zypper -n install {{ bootstrap_packages }}
stdout_regex: Nothing
|
| _bootstrap_packages | Alpine: python3 sudo
Amazon: python sudo
Archlinux: python sudo
CentOS_7: python sudo
Debian: python3 sudo gnupg python3-apt
Debian_8: python sudo gnupg
Debian_9: python sudo gnupg
Gentoo: python sudo gentoolkit
RedHat: python3 sudo
RedHat_7: python sudo
Suse: python3 python3-xml sudo
|
| bootstrap_packages | {{ _bootstrap_packages[bootstrap_distribution ~'_'~ bootstrap_distribution_major_version] \|default( _bootstrap_packages[bootstrap_distribution] ) \|default( _bootstrap_packages[bootstrap_os_family] ) }} |
| bootstrap_facts_packages | {{ _bootstrap_packages[ansible_distribution ~'_'~ ansible_distribution_major_version] \|default( _bootstrap_packages[ansible_distribution] ) \|default( _bootstrap_packages[ansible_os_family] ) }} |

## Author Information

none