Interview Prep/Ansible/Project Structure and Design

How do you bootstrap brand new servers?

IntermediateProductionProject Structure and Design
Answer

A dedicated bootstrap.yml play, run once with the initial credentials (root or the cloud default user), that does only what the normal runs depend on:

  • ensure Python (using raw if needed)
  • create the ansible automation user with SSH key and a sudoers drop-in
  • disable password SSH logins, set hostname, time sync, base packages

After it, every later run uses the automation user. Keeping bootstrap separate means normal playbooks never need a root password or special connection settings.

All Ansible questions Roadmap: Ansible

More on Project Structure and Design