community icon indicating copy to clipboard operation
community copied to clipboard

Fix ansible-lint violations and modernize Netdata ansible quck-start playbook

Open guiand888 opened this issue 4 months ago • 1 comments

Summary

There are several issues with the playbook at it is:

  • does not follow ansible syntax best practices (linting, FQCN, etc.)
  • implements "playbook" elements into tasks
  • use a script and installation methods that are deprecated

This PR fixes those issues.

Most importantly, it ensure the role remains functional as my-netdata.io/kickstart.sh is deprecated.

Key Changes

Ansible-lint Compliance

  • Fixed 25+ ansible-lint violations across all files
  • Passes production profile with 0 failures, 0 warnings
  • Uses FQCN for all modules (ansible.builtin.*)
  • Proper YAML formatting and ansible best practices

Modern Installation Approach

  • Replaced deprecated netdata-claim.sh script with modern kickstart.sh approach
  • Integrated installation and claiming
  • Intelligent reclaim logic - only uninstall if Netdata exists
  • Resolves repository conflicts during reclaim scenarios

Additional Installation Options

  • netdata_channel: Choose 'stable' or 'nightly' installation
  • netdata_auto_updates: Control automatic updates (default: false for automation)
  • Maintains backward compatibility with existing configurations (reinstall or reclaim)

Improved Structure

  • Created proper playbook.yml with playbook-level elements
  • Remove playbook-level elements for task files
  • Added handlers for service restarts
  • Fixed template variable handling

Usage

ansible-playbook -i hosts playbook.yml

Configuration Examples

# Use nightly channel with auto-updates
netdata_channel: nightly
netdata_auto_updates: true

# Reclaim existing installation
reclaim: true

guiand888 avatar Sep 07 '25 08:09 guiand888