154 lines
3.2 KiB
Markdown
154 lines
3.2 KiB
Markdown
# Role: development
|
|
|
|
## Description
|
|
Installs core development tools and utilities for software development. This role provides a lightweight foundation for coding without heavy data science dependencies.
|
|
|
|
**For data science tools (Anaconda, Jupyter, R), see the `datascience` role.**
|
|
|
|
## Requirements
|
|
- Ansible 2.9+
|
|
- Debian/Ubuntu systems
|
|
- Root or sudo access
|
|
|
|
## Installed Components
|
|
|
|
### Development Tools
|
|
- **git**: Version control system
|
|
- **build-essential**: C/C++ compilation tools (gcc, g++, make)
|
|
- **python3**: Python 3 interpreter
|
|
- **python3-pip**: Python package manager
|
|
|
|
### Node.js
|
|
- **Node.js 22.x**: Latest LTS from NodeSource
|
|
- **npm**: Node package manager (included with Node.js)
|
|
- Configured from official NodeSource repository
|
|
|
|
## Variables
|
|
|
|
### Core Settings
|
|
| Variable | Default | Description |
|
|
|----------|---------|-------------|
|
|
| `development_packages` | See defaults | Base packages installed by the role |
|
|
|
|
## Dependencies
|
|
- `base` role (for core utilities)
|
|
|
|
## Example Playbook
|
|
|
|
### Basic Installation
|
|
```yaml
|
|
- hosts: developers
|
|
roles:
|
|
- role: development
|
|
```
|
|
|
|
### Customize packages
|
|
```yaml
|
|
- hosts: developers
|
|
roles:
|
|
- role: development
|
|
vars:
|
|
development_packages:
|
|
- git
|
|
- build-essential
|
|
- python3
|
|
- python3-pip
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
# Install on specific host
|
|
make dev HOST=dev01
|
|
|
|
# Install only development tools (skip other roles)
|
|
ansible-playbook playbooks/development.yml --limit dev01 --tags development
|
|
```
|
|
|
|
## Tags
|
|
- `development`, `dev`: All development tasks
|
|
|
|
## Post-Installation
|
|
|
|
### Verify Installations
|
|
```bash
|
|
git --version
|
|
node --version
|
|
npm --version
|
|
python3 --version
|
|
```
|
|
|
|
### Node.js Usage
|
|
```bash
|
|
# Install packages globally
|
|
npm install -g <package>
|
|
|
|
# Check Node.js version
|
|
node --version # Should show v22.x
|
|
```
|
|
|
|
## Performance Notes
|
|
|
|
### Installation Time
|
|
- **Base packages**: 1-2 minutes
|
|
- **Node.js**: 1-2 minutes
|
|
- **Total**: ~3-5 minutes
|
|
|
|
### Disk Space
|
|
- **Node.js + npm**: ~100MB
|
|
- **Build tools**: ~50MB
|
|
- **Total**: ~150MB
|
|
|
|
## Integration
|
|
|
|
### With Data Science Role
|
|
```yaml
|
|
- hosts: datascience_workstation
|
|
roles:
|
|
- role: development # Core dev tools
|
|
- role: datascience # Anaconda, Jupyter, R
|
|
```
|
|
|
|
### With Docker
|
|
```yaml
|
|
- hosts: fullstack_dev
|
|
roles:
|
|
- role: development
|
|
- role: docker
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Node.js Version Issues
|
|
If Node.js doesn't upgrade to v22:
|
|
```bash
|
|
# Check current version
|
|
node --version
|
|
|
|
# Force reinstall
|
|
apt-get remove nodejs
|
|
# Re-run playbook
|
|
```
|
|
|
|
## Notes
|
|
- Node.js 22 is the current LTS version
|
|
- NodeSource repository is configured for automatic updates
|
|
- Build tools (gcc, make) are essential for npm native modules
|
|
- Python 3 is included for development scripts
|
|
- All installations are idempotent (safe to re-run)
|
|
|
|
## Comparison with Data Science Role
|
|
|
|
| Component | Development Role | Data Science Role |
|
|
|-----------|------------------|-------------------|
|
|
| Git | ✅ | - |
|
|
| Node.js | ✅ | - |
|
|
| Build Tools | ✅ | - |
|
|
| Anaconda | ❌ | ✅ |
|
|
| Jupyter | ❌ | ✅ |
|
|
| R Language | ❌ | ✅ |
|
|
| Install Time | ~10 min | ~30-60 min |
|
|
| Disk Space | ~150MB | ~3GB |
|
|
|
|
**Recommendation**: Use `development` role for general coding. Add `datascience` role only when needed for data analysis/ML work.
|