To run any playbook in the local system, you don't have to create an inventory file. You need to write localhost in the hosts section in your playbook or pass localhost in the command line as shown below.
[root@localhost ~]# ansible localhost -m command -a date
localhost | CHANGED | rc=0 >>
Mon Aug 10 22:57:24 IST 2020