This is a simple http server that runs ansible-playbooks It is written in Scala and based on the Play Framework.
Run as a Play app or as a docker image:
> sbt run
or
> sbt start</code>
The build.sbt uses GitVersioning, so you must set a version git tag in your repo.
> git tag mytag-0.1.0
> sbt docker:publishLocal
> docker run -d -v [path-to-playbooks]:/playbooks rocannon:mytag-0.1.0
Use http POST to http://rocannon/inventory-file/playbook-file[?refId=refId]
Where inventory-file and playbook-file may be relative to the playbook directory.
The data is json encoded extra-vars:
{
"variable1" : "value",
"variable2" : "value"
}
Make sure to use Content-Type:application/json
.
The optional refId
query parameter can be any string. And will be used in logs and the reply.
The bin/rocannon bash script can be used for convenience.
Json formatted, example:
{"buildId":606186755,"refId":"myId","status":"success","execTime":17,"message":"\nPLAY... trucated"}
Uses TypeSafes config. Use a -Dconfig.file switch to override. See TypeSafe/Play Framework for more info.
The following environment variables can be set
Name | Description | Default |
---|---|---|
ANSIBLE_COMMAND | Path to the ansible-playbook command | /usr/bin/ansible-playbook |
PLAYBOOKS | Path to the playbooks | /playbooks |
VAULT_PASSWORD | The vault password to use | changeme |
CRYPTO_SECRET | The play crypto secret to use | Should be set. |
LE_TOKEN | Logentries token | Will send logs to L``ogentries |