# https://sequencediagram.org/
title Puppet Agent eventually

participant User
participant Puppet Agent
participant #blue Puppetserver
participant #blue Fact terminus
participant #blue Node terminus
participant #blue Report processor

participant Smart Proxy
participant Foreman

User->Puppet Agent: apply
activate Puppet Agent
Puppet Agent->Puppetserver: Retrieve catalog
Puppetserver->Fact terminus: Invoke
activate Fact terminus
Fact terminus->Smart Proxy: POST /???
activate Smart Proxy
Smart Proxy->Foreman: POST /api/hosts/facts
activate Foreman
Smart Proxy<--Foreman: HTTP 201
deactivate Foreman
Fact terminus<--Smart Proxy: HTTP 201
deactivate Smart Proxy
deactivate Fact terminus
Puppetserver->Node terminus: Invoke
activate Node terminus
Node terminus->Smart Proxy: GET /???
activate Smart Proxy
Smart Proxy->Foreman: GET /node/:certname
activate Foreman
Smart Proxy<--Foreman: ENC
deactivate Foreman
Node terminus<--Smart Proxy: ENC
deactivate Smart Proxy
Puppetserver<--Node terminus: ENC
deactivate Node terminus
Puppet Agent<--Puppetserver: Catalog
Puppet Agent->Puppetserver: Send report
Puppetserver->Report processor: Invoke
activate Report processor
Report processor->Smart Proxy: POST /reports/puppet
Smart Proxy->(1)Foreman: POST /api/v2/config_reports
Report processor<--Smart Proxy: HTTP 200
deactivate Report processor
