deiga
deiga

Reputation: 1637

Is it possible to execute an ansible playbook from a URL?

I'd love to be able to run ansible-playbook -i <inventory_url> <playbook_url> from my machine, but it doesn't seem to work.

Does anyone know if this is at all possible?

Upvotes: 2

Views: 2711

Answers (2)

Bruce P
Bruce P

Reputation: 20739

Ansible itself doesn't let you do this. But Ansible Tower (a commercial product of theirs) does allow you to perform all sorts of Ansible-related tasks, including running playbooks, etc. through a REST interface.

Upvotes: 0

300D7309EF17
300D7309EF17

Reputation: 24603

No. You can see the source code here, which shows the playbooks are assumed to be local:

if not os.path.exists(playbook):
    raise errors.AnsibleError("the playbook: %s could not be found" % playbook)
if not (os.path.isfile(playbook) or stat.S_ISFIFO(os.stat(playbook).st_mode)):
        raise errors.AnsibleError("the playbook: %s does not appear to be a file" % playbook)

Here's the documentation on Python's os.path, showing that is meant for local files.

Upvotes: 1

Related Questions