Automating network infrastructures