TL;DR
- A well-named, clearly structured Polycrate workspace is half the battle: a consistent name (e.g.,
acme-corp-automation) and a simple directory structure prevent chaos before it starts. - Start with a few well-chosen blocks – depending on the role, e.g., Linux patching, Windows baseline management, or Kubernetes deployment – and consistently pin block versions instead of ever using
:latest. - Enable workspace encryption early, set up Git, and build your first custom block – this checklist makes onboarding reproducible and auditable.
- Common pitfalls include unencrypted secrets,
hosts: localhostinstead of correct inventories, and missing version pins; with Polycrate and best practices, you avoid these mistakes from the start. - ayedo supports you with Polycrate, practical best practices, projects, and consulting to turn your first workspace into a sustainable automation platform.
Why the First Workspace Matters
The first productive workspace is more than a test balloon. It sets the stage for how you will automate in the future:
- How consistently your teams work
- How well you meet compliance requirements like the GDPR effective since 05/25/2018
- How easily colleagues can take over and extend automations
Many start with plain Ansible and a quick ansible-playbook on their laptop – and months later face a zoo of playbooks, Python versions, and inventories. Ansible is powerful, but without guardrails, complexity grows faster than you'd like.
Polycrate gives Ansible a clear structure:
- Execution runs in a container → no local Python or Ansible chaos
- Workspace as a central project → guardrails against playbook sprawl
- Blocks as reusable building blocks → sharable automation across teams and registries
This post provides a concrete checklist for your first productive workspace – including name, structure, initial blocks, encryption, Git, and team onboarding.
Workspace Name and Structure: Best Practices from Day 1
Naming Concept
A good workspace name is:
- Descriptive
- Stable over years
- Independent of individuals or short-term projects
Proven pattern:
{company}-{area}-automationor{company}-{product}-platform
Examples:
acme-corp-automation(company-wide automation)acme-retail-platform(platform team for retail business)
Avoid: Names with personal references or environments (max-dev-playground, ansible-test).
Directory Structure
A typical workspace according to the best practices for Polycrate workspaces looks like this:
acme-corp-automation/
workspace.poly
inventory.yml
artifacts/
secrets/
kubeconfig.yml # if you use K8s
blocks/
linux-patch/
block.poly
patch.yml
windows-baseline/
block.poly
baseline.yml
k8s-deploy-app/
block.poly
deploy.yml
.git/
workspace.polydefines the workspace and block instancesinventory.yml(YAML!) is the central inventory for all Ansible playbooksblocks/contains your local blocks withblock.polyand playbooks in the same directoryartifacts/secrets/is the obvious place for encrypted files (via Polycrate workspace encryption)
Example workspace.poly
name: acme-corp-automation
organization: acme
blocks:
- name: linux-patch
from: linux-patch
config:
target_hosts: "linux_servers"
- name: windows-baseline
from: windows-baseline
config:
target_hosts: "windows_servers"
- name: k8s-deploy-app
from: k8s-deploy-app
config:
kubeconfig_path: ""
Important:
from:points to the subdirectory underblocks/for local blocks- No fields like
source:orversion:in the block entry (the version is in the block definition or registry tag) configat workspace level is not a free-form key-value map—only documented fields (e.g. toolchain image, paths); see Configuration. Set SSH users per host ininventory.yml(e.g.ansible_user)- There is no Jinja evaluation in
workspace.poly(no{{ workspace.secrets[...] }}). Put sensitive values forkubeconfig_pathinsecrets.poly(merged withworkspace.poly), not as templates inworkspace.poly - Replace the empty
kubeconfig_path: ""placeholder viasecrets.polyor after you know the real path
The First Custom Block: From Zero to Productive Action
Let's start with a minimal but productive example for Linux admins: a block for patching all Linux servers.
block.poly: Linux-Patching
name: linux-patch
version: 0.1.0
kind: generic
config:
target_hosts: "linux_servers"
actions:
- name: patch
description: "Patch Linux servers"
playbook: patch.yml
versionof the block is explicitly set – never work unversionedconfig.target_hostsdefines the host group the playbook targets- The action
patchclearly describes what happens: patching via Ansible
inventory.yml: Define Target Systems
all:
children:
linux_servers:
hosts:
server01.acme-corp.com:
ansible_user: ubuntu
server02.acme-corp.com:
ansible_user: ubuntu
windows_servers:
hosts:
win01.acme-corp.com:
ansible_user: Administrator
ansible_connection: winrm
ansible_port: 5986
ansible_winrm_server_cert_validation: ignore
This inventory is located at the workspace root (inventory.yml). Polycrate automatically sets ANSIBLE_INVENTORY to this file; you don't need to configure anything further in the block.
Ansible Playbook: patch.yml
- name: Patch Linux Servers
hosts: "{{ block.config.target_hosts }}"
become: true
gather_facts: true
tasks:
- name: Update package cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
- name: Upgrade all packages
ansible.builtin.apt:
upgrade: dist
autoremove: true
Important:
- No
hosts: localhostand noconnection: local– this would only affect the Polycrate container hostsis pulled from the block configuration and points to a group frominventory.yml- Idempotency: Running the playbook multiple times does not lead to unexpected side effects
Execution with Polycrate
polycrate run linux-patch patch
This fundamentally differs from plain Ansible:
- No
ansible-playbook -i inventory.yml patch.ymlon a locally configured system - No debate over Python 2.7 vs. 3.x, pip versions, or global
ansible.cfg - Ansible runs in a container, whose toolchain you define centrally – identical on all workstations
More on Ansible integration can be found in the official documentation:
https://docs.ayedo.de/polycrate/ansible/
Which Blocks First? Recommendations by Target Audience
For Linux Admins
Goal: Make routine tasks stable and reproducible.
Recommended first blocks:
linux-patch(as above)- User and SSH key management (
linux-users) - Basic hardening (e.g., CIS or company-specific minimum standards)
For hardening, consider using an official block from PolyHub (hub.polycrate.io) or building a custom block that reflects internal policies.
For Windows Admins
Goal: Automate standard tasks around AD, GPO, and software deployment.
Typical starting blocks:
windows-baseline: Base roles, PowerShell policy, agentswindows-software-deploy: Standard software via Ansiblewin_*modulesad-user-mgmt: User and group maintenance via Ansible modules for Active Directory
A block.poly for windows-baseline might look like this:
name: windows-baseline
version: 0.2.0
kind: generic
config:
target_hosts: "windows_servers"
actions:
- name: apply
description: "Apply Windows baseline"
playbook: baseline.yml
The playbooks use hosts: "{{ block.config.target_hosts }}" and the windows_servers group from the inventory – just like in the Linux example.
For Kubernetes and Platform Teams
Goal: Automate cluster operations via Ansible and additional tools (kubectl, Helm).
Useful first blocks:
k8s-deploy-app: Deliver application (manifests or Helm charts)k8s-cert-manager(often useful, via PolyHub block with pinned version)k8s-backup-ops: Recurring backup/restore tasks
A block.poly that uses a kubeconfig from the workspace:
name: k8s-deploy-app
version: 0.1.0
kind: generic
config:
kubeconfig_path: ""
actions:
- name: deploy
description: "Deploy app to cluster"
playbook: deploy.yml
In the playbook, you work with hosts: localhost and connection: local, because the API calls (e.g., kubernetes.core.k8s) go directly from the Polycrate container to the cluster – this is correct here, as the target endpoint is an API, not the container itself. More details can be found in the Kubernetes documentation:
https://docs.ayedo.de/polycrate/kubernetes/
Checklist: From Empty Git Repo to Productive Workspace
These steps have proven effective for getting started:
-
Create Git Repository
-git init acme-corp-automation
-.gitignorefor local artifacts, e.g.,*.retry, temporary files
- Set up remote (GitHub, GitLab, internal Git platform) -
Create Workspace
- Create directory, writeworkspace.poly(see above)
- Createinventory.ymland enter initial hosts – cleanly separated by groups -
Create First Block
- Underblocks/linux-patch/createblock.polyandpatch.yml
- Set version in block (version: 0.1.0)
- Test playbook:polycrate run linux-patch patch -
Enable Workspace Encryption
Polycrate comes with built-in encryption using age.
Typical process:- Polycrate guides you through the key setuppolycrate workspace encrypt
- Files likeartifacts/secrets/kubeconfig.ymlare stored encrypted
- You don't need an external vault – for many teams, the built-in solution is more than sufficient -
Consistently Pin Block Versions
- Custom blocks: maintainversionfield inblock.poly
- Registry blocks (example with a fictional company registry): always with tag:Never use- name: nginx-ingress from: registry.acme-corp.com/acme/infra/nginx-ingress:0.3.1:latest– this is the most common source of "suddenly everything is different". -
Integrate PolyHub Blocks (Where Appropriate)
- Standard topics like ingress, monitoring, logging can often come as ready-made building blocks from PolyHub
- Company-specific topics (policies, naming conventions, internal APIs) are better represented in custom blocks
Documentation on the registry:
https://docs.ayedo.de/polycrate/registry/
Overview of official blocks:
https://docs.ayedo.de/polycrate/polyhub/ and https://hub.polycrate.io/ -
Write Team Readme
- Short description: purpose of the workspace
- Examples:- Notes on workspace encryption and onboardingpolycrate run linux-patch patch polycrate run windows-baseline apply polycrate run k8s-deploy-app deploy
With this checklist, you will quickly have a workspace that is:
- Reproducible
- Version-controlled
- Encrypted
- Team-capable
– not just an experiment on your own laptop.
Common Mistakes When Starting – and How to Avoid Them
-
Using
hosts: localhostfor Real Servers
- Problem: Ansible runs in the Polycrate container and only changes this – the container is deleted afterwards
- Solution: Always use groups frominventory.yml(linux_servers,windows_servers, etc.); noconnection: localwhen managing hosts over SSH/WinRM -
Storing secrets unencrypted in Git
- Problem: Compliance, security, GDPR (since 05/25/2018)—plaintext credentials in Git are unacceptable today
- Solution: Enable workspace encryption early; put sensitive files underartifacts/secrets/and manage them encrypted -
Not pinning block versions
- Problem: A PolyHub update or local block change breaks existing deployments
- Solution: Always set versions inblock.polyand explicit registry tags; roll out changes via new versions -
Building too many blocks at once
- Problem: You lose oversight before any block is truly stable
- Solution: Start with 1–3 core blocks (Linux patching, Windows baseline, one K8s deployment), then modularize further -
Playbooks not named for teams
- Problem: In a few months nobody remembers whatmisc.ymldid
- Solution: Clear names (patch.yml,baseline.yml,deploy.yml) and matching action names (patch,apply,deploy)
Team Onboarding: Bringing Colleagues into the Workspace
Polycrate should not be a single-person tool but a shared platform. Teams report good results with:
-
Simple entry commands
- README front page: “How to run patching”
- Copy-paste commands:- No Ansible CLI knowledge required—Polycrate abstracts complexity via actionspolycrate run linux-patch patch -
Role-based onboarding
- Linux admins: focus onlinux-patchandlinux-users
- Windows admins:windows-baseline,windows-software-deploy
- K8s team:k8s-deploy-app, plus official K8s blocks from PolyHub as needed
This creates ownership: “This is my area, and I can act on it.” -
Shared guardrails
- Conventions for block names, action names, playbook layout
- Decide what comes from PolyHub vs. stays internal
Documented best practices help a lot. -
Training and pairing
- Short sessions where a senior colleague shows how a new block is created
- Pairing early so more people can change blocks without friction
With Polycrate you have the right foundation: containerized execution fixes the dependency problem, the block model adds structure and guardrails, and workspace encryption makes compliance easier without heavyweight external tools.
Frequently Asked Questions
Do I need Ansible and Python on every admin machine?
No. Polycrate solves this by running Ansible fully in the container. Locally you only need Polycrate and a container runtime (e.g. Docker or Podman). Ansible version, Python packages, and extra tools (kubectl, Helm, Azure CLI, etc.) are defined centrally in the toolchain container—everyone uses the same environment.
Can I reuse my existing Ansible playbooks?
Yes. In many starter projects we put existing playbooks into new blocks instead of rewriting everything:
- Migrate inventory to
inventory.ymlin the workspace - Adjust
hoststo reference groups and/or block configuration - Replace
ansible-playbookinvocations withpolycrate run BLOCK ACTION
The value comes from structure (blocks, workflows) and containerized execution. For a deeper migration we can plan together as part of our consulting.
What does ayedo do in Polycrate starter projects?
Typically:
- Joint definition of workspace structure and naming
- Building 2–4 core blocks (Linux, Windows, optionally Kubernetes/cloud)
- Introducing workspace encryption and Git workflows
- Supporting team onboarding (workshops, pairing, reviews)
The goal is always that your team can evolve Polycrate independently—we provide the scaffold and know-how. For questions, use our contact form or https://ayedo.de/kontakt/
More questions: FAQ
Next Steps
At the end of this series you have not a finished product but a toolkit: With a first clean workspace, clear blocks, and consistent versioning, you have a foundation that lasts.
Polycrate addresses hurdles many teams see with plain Ansible:
- The dependency problem goes away because the full toolchain runs in the container—consistent across workstations.
- The block model gives playbooks a structure you can version, share, and reuse—across the team or via registries like PolyHub.
- Workspace encryption with
agesimplifies handling sensitive data and helps meet compliance (e.g. GDPR since 05/25/2018) without introducing a separate vault product.
As the team behind Polycrate, ayedo supports you in this phase—from the first productive workspace to company-wide automation platforms. Our consulting offerings combine platform engineering practice with compliance, security, and enterprise architecture.
Whether you want to unify Linux and Windows administration, integrate Kubernetes clusters, or establish policy as code for audits—we define a workspace and block landscape that fits your organization.
If you do not want to plan your first productive workspace alone, or want to migrate existing Ansible cleanly into Polycrate, get in touch—with real examples from your day-to-day work.
Workshops and formats: Workshops · tailored support: Consulting.