I just started working with/learning to use Ansible.
I want to add hosts to an inventory file using a script, and I am wondering if there is a command line tool to accomplish that.
Something that looks like this;
ansible-inventory -i inventory.yml --add-host hostname --ip <ipaddress> --password <password>
I have looked through the documentation of Ansible, but I couldn't find a command that is able to change inventory files.
If there isn't a command for that, I just have to change the file itself in the script but I am not a big fan of that since I'm afraid that is prone to errors.