Base system configuration and essential packages for Ubuntu servers.
The Common role provides foundational system setup required by all other roles. It handles system updates, installs essential build dependencies, configures user permissions, and enables necessary system services. This role ensures the system is in a proper state for subsequent role execution.
- Ubuntu 20.04 LTS or later
- Ansible 2.12 or later
- sudo privileges on target hosts
The following variables can be set in defaults/main.yml:
# Essential system packages to install
essential_packages:
- build-essential
- pkg-config
- curl
- wget
- git
- ca-certificates
- gnupg
- lsb-release
# User configuration
target_user: "{{ ansible_user }}"
# System service configuration
enable_lingering: trueessential_packages: List of essential system packages required for developmenttarget_user: The user for which the environment is being configuredenable_lingering: Whether to enable user services to run without login
None. This is a base role that other roles depend on.
---
- hosts: servers
become: yes
roles:
- common- System Updates: Ensures package cache is updated
- Essential Packages: Installs build tools and development dependencies
- User Management: Configures user permissions and lingering services
- Validation: Includes validation tasks for system state
- Error Handling: Comprehensive error handling and validation patterns
The role includes validation tasks that verify:
- Essential packages are properly installed
- User configuration is correct
- System services are in expected state
MIT
Development Team - Internal Use