The obscene docker-compose deploy with ansible cli
Project description
Deploying a docker-compose.yml
Provide ssh configuration and target dir as first argument, then the path to a docker-compose.yml file:
ansible-compose user@host:22/absolute/target/path ./docker-compose-example.yml
Or, deploy from a url, just like kubectl apply would let you:
ansible-compose user@host:22/absolute/target/path https://raw.git.../docker-compose.yml
Automatic creation of volume dirs
It will try to automatically create the volume bind dirs for you. To set the uid and/or guid, set them as env vars, either in the compose.yml:
environment: uid: 1001 gid: 100
Or on the command line
Transforms for docker-compose.yml on the CLI
You can also apply transforms to the docker-compose.yml on the command line with env vars: servicename_environment_something=foo will overwrite the something env var of the servicename service with the foo value, whereas setting drop_servicename_environment_something=1 will drop the value at all.
This kind of filter will also work on service options ie. servicename_image=foo or drop_servicename_image=1 would respectively override and drop the image key of the servicename service. It also works on services themselves, and any other key at the first level of the compose document.
Note that any other argument will be passed to ansible-playbook.
Running commands on the compose of a target
Provide ssh configuration and target dir as first argument, then the docker-compose command:
ansible-compose user@host:22/absolute/target/path stop ansible-compose user@host:22/absolute/target/path start ansible-compose user@host:22/absolute/target/path logs ansible-compose user@host:22/absolute/target/path help
Installation
pip install --user ansible-container export PATH="$HOME/.local/bin:$PATH" echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ansible-compose-0.1.0.post1.tar.gz
.
File metadata
- Download URL: ansible-compose-0.1.0.post1.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a02bc70255a5370beb3e1ed19840d25d892b6e5fc46aae1bd4a28ff3f694c17 |
|
MD5 | 73698e9b19d2aa02812a80c01b85e778 |
|
BLAKE2b-256 | 3033a2424742e1b5217a2b24019824c79b1ceef48ca31b1a56742702b1613c94 |