Ancients might be aware of astronomy, though not explicitly mentioned in earlier literature like Vedas.
However, those people might not have shown much interest in astrological predictions. As Veda contain multi-layered meaning, they might be referring to astronomical as well as Spiritual aspects also.
Sun being devoured by Svarbhanu was mentioned in Rig Veda V.40.5.
While narrating the birth of Sri Rama in Ramayana, the positions of grahas were mentioned.
ततो यज्ञे समाप्ते तु ऋतूनां षट् समत्ययुः | ततश्च द्वादशे मासे चैत्रे
नावमिके तिथौ || १-१८-८
नक्षत्रेऽदितिदैवत्ये स्वोच्चसंस्थेषु पंचसु | ग्रहेषु कर्कटे लग्ने
वाक्पताविंदुना सह || १-१८-९
प्रोद्यमाने जगन्नाथं सर्वलोकनमस्कृतम् | कौसल्याजनयद्रामं
सर्वलक्षणसंयुतम् || १-१८-१०
विष्णोरर्धं महाभागं पुत्रमैक्ष्वाकुनंदनम् | लोहिताक्षं महाबाहुं
रक्तौष्ठं दुंदुभिस्वनम् || १-१८-११
On completion of the ritual, six seasons have passed by; then in the
twelfth month, i.e., in chaitra-mAsa, and on the ninth day of that
chaitra month [April-May], when it is punarvasunakShatrayukta-navamI
tithi, i.e., when the ruling star of that ninth day is punarvasu, for
which Aditi is the presiding deity; and when five of the nine planets
- sUrya, kuja, guru, shukra, shani are in ucChasthAna-s, namely, when those planets are in ascension in their respective houses - meSha,
makara, karkaTa, mIna, tula - rAshI-s; and when chandrayukta- guru,
karkaTalagne - Jupiter in conjuction with Moon is ascendant in Cancer,
and when day is advancing, Queen Kausalya gave birth to a son with all
the divine attributes like lotus-red eyes, lengthy arms, roseate lips,
voice like drumbeat, and who took birth to delight the Ikshwaku
dynasty and adored by all the worlds, and who is the greatly blessed
epitome of Vishnu, namely Rama.
There was indeed a mention about RAHU, while describing Moon eclipse in Sundara Kanda of Srimad Ramayana.
वेदीमिव परामृष्टां शान्तामग्निशिखामिव |
पौर्णमासीमिव निशां राहुग्रस्तेन्दुमण्डलाम् || ५-१९-१५
Seetha was like an altar desecrated, like a tongue of fire gone out,
like a full moon night with moon devoured by Rahu.
In Sundara Kanda, there was a mention about constellations like Pushya and Shravana, etc.
सचन्द्र कुमुदम् रम्यम् सार्क कारण्डवम् शुभम् | तिष्य श्रवण कदम्बम्
अभ्र शैवल शाद्वलम् || ५-५७-१
पुनर्वसु महामीनम् लोहित अन्ग महाग्रहम् | ऐरावत महाद्वीपम् स्वाती हंस
विलोडितम् || ५-५७-२
वात सम्घात जात ऊर्मिम् चन्द्र अंशु शिशिर अम्बुमत् | भुजम्ग यक्ष
गन्धर्व प्रबुद्ध कमल उत्पलम् || ५-५७-३
हनुमान् मारुतगतिर्महानौरिव सागरम् | अपारमपरिश्रान्तः पुप्लुवे
गगनार्णवम् || ५-५७-४
Hanuma, with a rush equal to that of wind, withaut a fatigue, leapt
across the baundless sea looking analogaus to sky, like a large ship
crossing the ocean.
In that pleasant and auspiciaus sky-like sea, shone the moon as a
white water-like sea, shone having the constellations known by the
names of Pushya and Shravana as swans, the clauds as its
duck-weeds; the twin constellations the Punarvasus as its large
fish, the planet Mars as its large alligator, a large island as
Airavata (Indra's elephant), graced with a swan in the form of the
constellation, Shwati, having gales as its waves, the moon
bea.ns as its cool water and with the Nagas, yakshas and Gandharvas as
its full blown lotuses and water-lilies.