Recently RedHat released Ansible tower as open source as the AWX project. So I've imported my local Ansible project into AWX, but manually importing alot of host and group vars can be a bit tedious.

Using tower-cli this can thankfully be automated.

To import all host vars in a directory, where each file is a FQDN matching the hostname in AWX, use:

for FILE in $(find . -depth 1 -type f); do tower-cli host modify --variables @${FILE#\./} --name=${FILE#\./} -i 2; done

To do the same for groups:

for FILE in $(find . -depth 1 -type f); do tower-cli group modify --variables @${FILE#\./} --name=${FILE#\./} -i 2; done

And you are done :)