Is there a source for the story about the sun being covered by the cloud? A common analogy about mindfulness I hear about is that the wisdom is like the sun. It is always shining there, but is frequently clouded. Your job is to avoid as much cloud as possible, and when there is no cloud left, you are enlightened.

Where is this analogy first use? Is there a sutta for this? If not, and if you have heard about this too, can you name the source that you first knew it?
it is not exactly what you want, but first there is this


  "Just as, monks, from time to time a strong wind scatters and causes
  to vanish a great mass of clouds that has arisen, even so a monk who
  cultivates and makes much of the seven limbs of wisdom from time to
  time scatters and causes to vanish the ill, unprofitable states that
  rise and rise again.


http://obo.genaud.net/dhamma-vinaya/pts/sn/05_mv/sn05.46.099-110.wood.pts.htm#p107

http://obo.genaud.net/dhamma-vinaya/pts/sn/05_mv/sn05.46.099-110.wood.pts.htm#p106

what you seek is found in Theragatha


  Who once was heedless,[1] but later is not,    brightens the world
  like the moon set free from a cloud.
  
  His evil-done deed[2] is replaced with skillfulness:    he brightens
  the world    like the moon set free from a cloud.


http://obo.genaud.net/dhamma-vinaya/ati/kd/thag/thag.255.than.ati.htm

and in MN http://obo.genaud.net/dhamma-vinaya/bd/mn/mn.112.olds.bd.htm


  Then, by letting go these five bindups, afflictions of the heart,
  crippling to wisdom, separating myself from sense pleasures,
  separating myself from unskillful things, with rethinking, with
  reminiscing,[13] there came the pleasurable Enthusiasm born of
  solitude inhabiting the first burning.
  
  Then, rethinking and reminiscing calmed, inwardly impassive, become
  unified in heart, without rethinking, without reminiscing, there came
  the pleasurable Enthusiasm born of serinity inhabiting the second
  burning.
  
  Then, Enthusiasm fading, living detached, recollected and self-aware,
  there came the experiencing of the bodily pleasure inhabiting the
  third burning of which the Aristocrats delcare:
  
  'Detached, recollected, he lives happily.'
  
  Then, letting go of pleasure, letting go of pain, their precursers in
  mental ease and discomfort having found their own way home, without
  pain or pleasure, there came the utter purity of the detached mind
  inhabiting the fourth burning.
  
  Then, thus with calm heart, pure, clean, debtless, without
  afflictions, become soft, capable, steadfast, unshakable, the heart
  bent down to knowledge of the eradication of the corruptions.
  
  Then the knowledge: 'This is pain' emerged as though a splendid light
  from a dark cloud, the knowledge: 'This is the source of pain' emerged
  as though a splendid light from a dark cloud, the knowledge: 'This is
  the end to pain' emerged as though a splendid light from a dark cloud,
  the knowledge: 'This is the way to walk to the end of pain' emerged as
  though a splended light from a dark cloud.
  
  Then the knowledge: 'This is corruption' emerged as though a splended
  light from a dark cloud, the knowledge: 'This is the source of
  corruption' emerged as though a splended light from a dark cloud, the
  knowledge: 'This is the end to corruption' emerged as though a
  splended light from a dark cloud, the knowledge: 'This is the way to
  walk to the end of corruption' emerged as though a splended light from
  a dark cloud.
  
  When I knew thus, saw thus, I was freed in heart from the corruption
  of sense pleasures, freed in heart from the corruption of living,
  freed in heart from the corruption of blindness.
  
  In freedom I thought: "I am free' and had the knowledge:
  
  'Birth: left behind, carrying on as Brahma: finished, duty's doing:
  done, no further it'n-n-at'n is to be known for me'.
  
  Even so, my friends, thus knowing, seeing, with regard to this body
  with consciousness and all external signs, I say that 'Bias towards
  me- my-making is uprooted.'


http://obo.genaud.net/dhamma-vinaya/pts/an/10_tens/an10.015.wood.pts.htm

You also have the variant with the rain cloud
http://obo.genaud.net/a/dhamma-vinaya/wp/sn/05_mv/sn05.45.149-160.bodh.wp.htm