Contributing to the Fedora Desktop Configuration Manager.
This guide helps you:
- Set up your development environment
- Understand the branching strategy
- Follow Ansible style guidelines
- Test your changes
- Submit pull requests
Essential reading for:
- First-time contributors
- Anyone adding new playbooks
- Maintainers creating version branches
Quick links:
- Development setup - Get started
- Ansible style guide - Code standards
- Testing procedures - Verify your changes
- Pull request process - Submit changes
- IDE: PyCharm Community Edition
- Plugins:
- Linting: ansible-lint
# Clone repository
git clone https://github.com/LongTermSupport/fedora-desktop.git
cd fedora-desktop
# Install development dependencies
sudo dnf install -y ansible ansible-lint
# Install Ansible Galaxy requirements
ansible-galaxy install -r requirements.yml
# Set up pre-commit hooks (if using)
pre-commit install- Format:
F<VERSION>(e.g.,F42,F43) - Each branch targets specific Fedora version
- Version defined in
vars/fedora-version.yml
When Fedora releases a new version:
# 1. Update version in configuration
vim vars/fedora-version.yml
# Change: fedora_version: 43
# 2. Commit the change
git add vars/fedora-version.yml
git commit -m "Update target Fedora version to 43"
# 3. Create and push new branch
git checkout -b F43
git push -u origin F43
# 4. Set as default branch on GitHub
gh repo edit --default-branch F43
# 5. Update branch-specific changes
# - Test all playbooks
# - Update package versions if needed
# - Fix any compatibility issues- Active: Current Fedora version branch
- Maintenance: Previous version (critical fixes only)
- Archive: Older versions (reference only)
- hosts: desktop
name: Descriptive Name # Clear, action-oriented
become: true # Only if needed
vars:
root_dir: "{{ inventory_dir }}/../../"
vars_files:
- "{{ root_dir }}/vars/fedora-version.yml" # If version-dependent
tasks:
- name: Clear task description
module_name:
parameter: valueAlways use blockinfile over lineinfile:
- name: Update configuration
blockinfile:
path: /path/to/file
marker: "# {mark} ANSIBLE MANAGED: Purpose"
block: |
configuration content
create: yes # If file should be created
owner: "{{ user_login }}"
group: "{{ user_login }}"
mode: '0644'# Simple installations
- name: Install packages
package:
name: "{{ packages }}"
state: present
vars:
packages:
- package1
- package2
# Fedora-specific features
- name: Install from DNF
dnf:
name: package-name
state: present
enablerepo: repo-name # If needed- Use descriptive names:
user_login, notul - Group related variables:
lastpass_accounts,github_accounts - Document complex variables with comments
- Group related tasks with
block - Use meaningful tags for selective execution
- Order tasks logically: checks → installation → configuration
# Syntax check
ansible-playbook playbooks/playbook-main.yml --syntax-check
# Dry run
ansible-playbook playbooks/playbook-main.yml --check
# Run specific tags
ansible-playbook playbooks/playbook-main.yml --tags packages
# Test individual playbook
ansible-playbook playbooks/imports/play-basic-configs.yml -vv# Verbose output levels
-v # Basic debug
-vv # More detailed
-vvv # Connection debug
-vvvv # Full debug
# Step through execution
ansible-playbook playbook.yml --step
# Start at specific task
ansible-playbook playbook.yml --start-at-task="Task Name"# View all facts
ansible desktop -m setup
# Filter facts
ansible desktop -m setup -a "filter=ansible_distribution*"
# Save facts to file
ansible desktop -m setup --tree /tmp/facts- Test on fresh Fedora installation
- Verify idempotency (run twice, no changes second time)
- Check style compliance with ansible-lint
- Update documentation if adding features
- Test both with and without third-party repos
- Fork repository
- Create feature branch from appropriate version branch
- Make changes following style guide
- Test thoroughly
- Submit PR with clear description
-
Create in appropriate directory:
imports/for core featuresimports/optional/common/for general optional featuresimports/optional/hardware-specific/for hardware supportimports/optional/experimental/for bleeding-edge
-
Follow naming convention:
play-<feature-name>.yml -
Include standard headers:
- hosts: desktop
name: Feature Description
become: true # If needed
vars:
root_dir: "{{ inventory_dir }}/../../"- Document in
docs/playbooks.md
Use conventional format:
type: description
- Detail 1
- Detail 2
Fixes #issue
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Formattingrefactor: Code restructuringtest: Testingchore: Maintenance
# Encrypt sensitive variables
ansible-vault encrypt_string 'secret' --name 'var_name'
# Always use vault for:
# - API keys
# - Passwords
# - Tokens
# - Private configuration- name: Secure file
copy:
src: source
dest: /path/to/dest
owner: "{{ user_login }}"
group: "{{ user_login }}"
mode: '0600' # Restrictive for sensitive filesvault-pass.secret- Personal API keys
- SSH private keys
- Temporary files in
untracked/