Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 1.88 KB

File metadata and controls

81 lines (56 loc) · 1.88 KB

Common Role

Base system configuration and essential packages for Ubuntu servers.

Description

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.

Requirements

  • Ubuntu 20.04 LTS or later
  • Ansible 2.12 or later
  • sudo privileges on target hosts

Role Variables

Available Variables

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: true

Variable Descriptions

  • essential_packages: List of essential system packages required for development
  • target_user: The user for which the environment is being configured
  • enable_lingering: Whether to enable user services to run without login

Dependencies

None. This is a base role that other roles depend on.

Example Playbook

---
- hosts: servers
  become: yes
  roles:
    - common

Features

  • 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

Validation

The role includes validation tasks that verify:

  • Essential packages are properly installed
  • User configuration is correct
  • System services are in expected state

License

MIT

Author Information

Development Team - Internal Use