Thanks for your reply.
I did upgrade the ansible by:
sudo pip3 install ansible-core==2.15
and now the ansible-core is updated:
$ ansible --version
ansible [core 2.15.0]
config file = /home/ansible/.ansible.cfg
configured module search path = ['/home/ansible/library']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.10 (main, Sep 23 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
after running the command:
ansible-galaxy collection install fortinet.fortios
i get the error message:
ERROR! Unknown error when attempting to call Galaxy at '
https://galaxy.ansible.com/api/': <urlopen error [Errno -2] Name or service not known>. <urlopen error [Errno -2] Name or service not known>