Molecule converge fails on service tasks with `System has not been booted with systemd as init system (PID 1). Can't operate.`
AdvancedTroubleshootingCloud, AWX, Windows and Molecule
Answer
Likely causes → The test container runs a shell or sleep as PID 1, not systemd. On cgroup v2 hosts (Ubuntu 22.04+ runners, recent Docker Desktop), systemd containers also need the right cgroup setup.
Fix →
platforms:
- name: rocky9
image: geerlingguy/docker-rockylinux9-ansible:latest
command: /usr/sbin/init
privileged: true
cgroupns_mode: host
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
pre_build_image: true
Prevent → Use images built for systemd testing, and keep a known-good molecule.yml template that every role copies.
More on Cloud, AWX, Windows and Molecule
`Failed to import the required Python library (botocore and boto3) on web01's Python /usr/bin/python3.`Beginner`[WARNING]: * Failed to parse inventory/aws.yml with auto plugin: inventory source 'inventory/aws.yml' could not be verified by inventory plugin 'amazon.aws.aws_ec2'`IntermediateThe `aws_ec2` inventory parses without errors but returns zero hostsIntermediate`Failed to describe instances: An error occurred (UnauthorizedOperation) when calling the DescribeInstances operation` or `(ExpiredToken)`IntermediateDynamic inventory finds the instances, but every host is `UNREACHABLE`IntermediateUsing the SSM connection plugin fails with `SessionManagerPlugin is not found` or hangs on file transferAdvanced