This work is about the use of artificial intelligence (AI) planning techniques to automatically configure a group of cooperating robots. In particular, we study societies of autonomous robotic systems in which robots can help each other by offering information-producing resources and functionalities. A configuration in our societies is a way to allocate and connect functionalities among robots. In general, different configurations can be used to solve the same task, depending on the current situation. In this paper, we show a general approach to define, generate, and execute configurations. We use knowledge-based planning to automatically generate a configuration for a given task, environment, and set of resources. We describe an experimental system where these ideas are implemented, and show an example of it in which two robots mutually help each other to cross a door.