Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting docker_host and log_driver #5

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
A [default configuration](defaults/main.yml) is provided in this role. It establishes a cache service based on the freedesktop-sdk buildbox-casd Docker image with persistent storage. The following variables are defined:

- `casd_cache`: the path to the cache on the host
- `casd_docker_host`: The path (or address) to use to connect to the docker API, can be used for example to run the container with podman
- `casd_image`: the Docker image to use in instantiating the container
- `casd_container`: the container name
- `casd_network`: the name of the Docker network to create and attach the service container to
- `casd_network_connected_containers`: a list of containers to connect to the network being created for buildbox-casd
- `casd_log_driver`: the log driver to use for the buildbox-casd container
- `casd_log_options`: additional options to pass to the log driver
- `casd_port`: the port the service listens to in the container and which is exposed on the container
- `casd_published_ports`: a list of docker port specifications to be published. This does not affect whether the port on which buildbox-casd is listening is exposed.
- `casd_bind_address`: the address the service listens to inside the container
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ casd_cache: "/srv/buildbox_casd/cache"
casd_proxy_certdir: "/srv/buildbox_casd/certs"

# container config
casd_docker_host: "unix:///var/run/docker.sock"
casd_image: "registry.gitlab.com/freedesktop-sdk/infrastructure/freedesktop-sdk-docker-images/buildbox-casd"
casd_container: "buildbox-casd"
casd_network: "{{ casd_container }}-net"
casd_network_connected_containers: []
casd_port: 11001
casd_publish_ports: []
casd_labels: {}
casd_log_driver: ""
casd_log_options: {}

# casd metrics
# Must be one of udp://<statsd_server>:<port>, file://<path> or stderr
Expand Down
4 changes: 4 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
name: "{{ casd_network }}"
connected: "{{ [] if casd_bind_path else casd_network_connected_containers }}"
appends: true
docker_host: "{{ casd_docker_host }}"

- name: Bring up buildbox-casd
community.docker.docker_container:
Expand All @@ -72,3 +73,6 @@
labels: "{{ casd_labels }}"
comparisons:
'*': strict
docker_host: "{{ casd_docker_host }}"
log_driver: "{{ casd_log_driver }}"
log_options: "{{ casd_log_options }}"