Peer-to-peer computing principles have started to pervade into mechanical control systems, inducing a paradigm shift from centralized to autonomic control. We have developed a self-contained, miniaturized, universal and scalable peer-to-peer based hardware-software system, the peer-it platform, to serve as a stick-on computer solution to raise real-world artefacts like, for example, machines, tools, or appliances towards technology-rich,autonomous, self-induced, and context-aware peers, operating as spontaneously interacting ensembles. The peer-it platform integrates sensor, actuator, and wireless communication facilities on the hardware level, with an object-oriented, component-based coordination framework at the software level, thus providing a generic platform for sensing, computing,controlling, and communication on a large scale. The physical appearance of a peer-it supports pinning it to real-world artefacts, while at the same time integrating those artefacts into a mobile ad hoc network of peers. Peer-it networks thus represent ensembles of coordinated artefacts, exhibiting features of autonomy like self-management at the node level and self-organization at the network level. We demonstrate how the peer-it system implements the desired flexibility in automated manufacturing systems to react in the case of changes, whether intended or unexpectedly occuring. The peer-it system enables machine flexibility in that it adapts production facilities to produce new types of products, or change the order of operation executed on parts instantaneously. Secondly, it enables routing flexibility, that is, the ability to use multiple machines to spontaneously perform the same operation on one part alternatively (to implement autonomic fault tolerance) or to absorb large-scale changes in volume, capacity, or capability (to implement autonomic scalability).