27.1 Push vs Pull — Πότε τι 🔄

Push model (default)

Push model (ansible-playbook):

  Controller ──SSH──► Host A
  Controller ──SSH──► Host B
  Controller ──SSH──► Host C

  Πλεονεκτήματα:
  ✅ Centralized control
  ✅ On-demand execution
  ✅ Easy debugging
  ✅ Άμεση ανατροφοδότηση

  Μειονεκτήματα:
  ❌ Controller χρειάζεται SSH access σε ΟΛΟΥΣ τους hosts
  ❌ Scale: 1000+ hosts → αργό (ακόμα και με forks)
  ❌ Firewall: inbound SSH σε managed hosts

Pull model (ansible-pull)

Pull model (ansible-pull):

  Git Repo ◄──── push ──── Developer

  Host A ──► git clone ──► local run ──► configure self
  Host B ──► git clone ──► local run ──► configure self
  Host C ──► git clone ──► local run ──► configure self

  Πλεονεκτήματα:
  ✅ Scale: 10.000+ hosts (κάθε host φροντίζει τον εαυτό του)
  ✅ Firewall: ΜΟΝΟ outbound git (443/80)
  ✅ No central controller needed
  ✅ Bootstrap νέων hosts (cloud-init!)
  ✅ Ephemeral/auto-scaling environments

  Μειονεκτήματα:
  ❌ Delay: δεν εκτελείται αμέσως
  ❌ Δύσκολο debugging
  ❌ Credentials στον host (git token)

Πότε τι

Χρήσιμο το PULL για:
├── Large fleets (100+ servers)
├── Auto-scaling instances (cloud)
├── Bootstrap νέων hosts (cloud-init)
├── Airgapped environments (no inbound SSH)
└── Self-healing systems

Χρήσιμο το PUSH για:
├── Small/medium setups (<50 hosts)
├── Interactive deployments
├── Databases, sensitive operations
└── Debugging & troubleshooting

Σύνοψη 27.1

Push vs Pull
│
├── Push: controller → SSH → hosts (default)
│   └── Καλό για μικρά/μεσαία setups
│
└── Pull: hosts → git → run locally
    └── Καλό για μεγάλα fleets, cloud, bootstrap