We propose a novel generalized framework for grant-free random-access (GFRA) in cell-free massive multiple input multiple-output systems where multiple geographically separated access points (APs) or base stations (BSs) aim to detect sporadically active user-equipment (UEs). Unlike a conventional architecture in which all the active UEs transmit their signature or pilot sequences of equal length, we admit a flexible pilot length for each UE, which also enables a seamless integration into conventional grant-based wireless systems. We formulate the joint UE activity detection and the distributed channel estimation as a sparse support and signal recovery problem, and describe a Bayesian learning procedure to solve it. We develop a scheme to fuse the posterior statistics of the latent variables inferred by each AP to jointly detect the UEs' activities, and utilize them to further refine the channel estimates. In addition, we allude to an interesting point which enables this flexible GFRA framework to encode the information bits from the active UEs. We numerically evaluate the normalized mean square error and the probability of miss-detection performances obtained by the Bayesian algorithm and show that the latent-variable fusion enhances the detection and the channel estimation performances by a large margin. We also benchmark against a genie-aided algorithm which has a prior knowledge of the UEs' activities.