Skip to content

Latest commit

 

History

History
338 lines (266 loc) · 11.2 KB

README.orig.adoc

File metadata and controls

338 lines (266 loc) · 11.2 KB

ansible-role-bootstrap

Version on Galaxy Testing CI

An Ansible role for preparing a linux system to be managed by ansible.

This role uses the ansible.builtin.raw module in combination with an own-implemented "Operating System determination system" to install the minimum required set of packages (python and sudo) in order to allow Ansible to manage a system.

This role also ensures an up-to-date package cache for most systems.

In most cases, you will want to use this role in combination with my core_dependencies-role.

ℹ️
DISCLAIMER

This role is a fork of robertdebock/ansible-role-bootstrap v5.2.12 (27 January, 2022) (Apache License 2.0, Copyright Robert de Bock (robert@meinit.nl)) with various changes/fixes.
Excerpt of changes from /releases below (with accompanying Issues in robertdebock’s repository):

🔎 Metadata

Below you can find information on…

  • the role’s required Ansible version

  • the role’s supported platforms

  • the role’s role dependencies

link:meta/main.yml[role=include]

📌 Requirements

The Ansible User needs to be able to become.

📜 Role Variables

bootstrap_user: root

Username used to connect to the machine for the primary raw tasks of gathering simple facts / installing.

bootstrap_become: false
bootstrap_become_user: root

become and become_user variables passed to most actual tasks.

The default value of bootstrap_become was set to false because of the assumption that sudo is not available before bootstrapping.

bootstrap_wait_for_host: false

Whether to wait for the host to be available on ansible_port (22).

bootstrap_timeout: 3

Maximum number of seconds to wait for the remote system to be reachable/usable before failing.

📜 Facts/Variables defined by this role

Each variable listed in this section is dynamically defined when executing this role (and can only be overwritten using ansible.builtin.set_facts) and is meant to be used not just internally.

🏷️ Tags

Tasks are tagged with the following tags:

Tag Purpose

This role does not have officially documented tags yet.

You can use Ansible to skip tasks, or only run certain tasks by using these tags. By default, all tasks are run when no tags are specified.

👫 Dependencies

📚 Example Playbook Usages

You must disable the gather_facts-property of the play this role is used in. If this role finished successfully it’ll call ansible’s setup module itself (equivalent effect that gather_facts: true would give).

No tasks must come before this role.

Example 1. Minimum Viable Play
---
- hosts: servers:&provisioned
  name: Bootstrap linux machines to be managed by Ansible.
  become: false
  gather_facts: false

  roles:
    - role: jonaspammer.bootstrap
Example 2. Changing bootstrap user (e.g. when root is not an option)
---
- hosts: servers:&provisioned
  name: Bootstrap linux machines to be managed by Ansible.
  become: false
  gather_facts: false

  vars:
    bootstrap_user: "{{ ansible_user }}"

  roles:
    - role: jonaspammer.bootstrap
Example 3. Using become true (e.g. when you know you at-least have an useable sudo)
---
- hosts: servers:&provisioned
  name: Bootstrap linux machines to be managed by Ansible.
  become: true
  gather_facts: false

  vars:
    bootstrap_user: "{{ ansible_user }}"
    bootstrap_become: true

  roles:
    - role: jonaspammer.bootstrap

🧪 Tested Distributions

A role may work on different distributions, like Red Hat Enterprise Linux (RHEL), even though there is no test for this exact distribution.

OS Family Distribution Distribution Release Date Distribution End of Life Accompanying Docker Image

Rocky

Rocky Linux 8 (RHEL/CentOS 8 in disguise)

2021-06

2029-05

CI

Rocky

Rocky Linux 9

2022-07

2032-05

CI

RedHat

Fedora 39

2023-11

2024-12

CI

Debian

Ubuntu 20.04 LTS

2021-04

2025-04

CI

Debian

Ubuntu 22.04 LTS

2022-04

2027-04

CI

Debian

Debian 11

2021-08

2024-06 (2026-06 LTS)

CI

Debian

Debian 12

2023-06

2026-06 (2028-06 LTS)

CI

🧪 Tested Ansible versions

The tested ansible versions try to stay equivalent with the support pattern of Ansible’s community.general collection. As of writing this is:

  • 2.13 (Ansible 6)

  • 2.14 (Ansible 7)

  • 2.15 (Ansible 8)

  • 2.16 (Ansible 9)

📝 Development

💪 Contributing

🗒 Changelog

Please refer to the Release Page of this Repository for a human changelog of the corresponding Tags (Versions) of this Project.

Note that this Project adheres to Semantic Versioning. Please report any accidental breaking changes of a minor version update.

⚖️ License

link:LICENSE[role=include]