Skip to content

Latest commit

 

History

History
109 lines (71 loc) · 5.47 KB

README.md

File metadata and controls

109 lines (71 loc) · 5.47 KB

stephrobert.bootstrap

Maintainer License Release Status Ansible GalaxyAnsible version

⭐ 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

ansible-galaxy install stephrobert.bootstrap

Install with git

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

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.

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:

- 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