Role to run watchtower in a docker container
- Default Variables
- docker_container_watchtower_debug
- docker_container_watchtower_env
- docker_container_watchtower_image
- docker_container_watchtower_label_enable
- docker_container_watchtower_labels
- docker_container_watchtower_log_level
- docker_container_watchtower_monitor_only
- docker_container_watchtower_name
- docker_container_watchtower_networks
- docker_container_watchtower_notification_url
- docker_container_watchtower_notifications_hostname
- docker_container_watchtower_notifications_level
- docker_container_watchtower_notifications_title_tag
- docker_container_watchtower_ports
- docker_container_watchtower_schedule
- docker_container_watchtower_timezone
- docker_container_watchtower_volume_dir
- docker_container_watchtower_volumes
- docker_image_watchtower_name
- docker_image_watchtower_pull
- docker_network_watchtower_name
- Discovered Tags
- Dependencies
- License
- Author
Enable debug mode with verbose logging.
docker_container_watchtower_debug: 'false'
Dictionery of key,value pairs for docker environment variables to configure watchtower.
Example:
docker_container_watchtower_env:
WATCHTOWER_MONITOR_ONLY: "true"
docker_container_watchtower_env:
WATCHTOWER_DEBUG: '{{ docker_container_watchtower_debug }}'
WATCHTOWER_LABEL_ENABLE: '{{ docker_container_watchtower_label_enable }}'
WATCHTOWER_LOG_LEVEL: '{{ docker_container_watchtower_log_level }}'
WATCHTOWER_MONITOR_ONLY: '{{ docker_container_watchtower_monitor_only }}'
WATCHTOWER_NOTIFICATIONS_HOSTNAME: '{{ docker_container_watchtower_notifications_hostname
| default(omit) }}'
WATCHTOWER_NOTIFICATIONS_LEVEL: '{{ docker_container_watchtower_notifications_level
}}'
WATCHTOWER_NOTIFICATION_TITLE_TAG: '{{ docker_container_watchtower_notifications_title_tag
| default(omit) }}'
WATCHTOWER_NOTIFICATION_URL: '{{ docker_container_watchtower_notification_url }}'
WATCHTOWER_SCHEDULE: '{{ docker_container_watchtower_schedule }}'
TZ: '{{ docker_container_watchtower_timezone }}'
Repository path and tag used to create the container. If an image is not found or pull is true, the image will be pulled from the registry. If no tag is included, latest will be used.
docker_container_watchtower_image: '{{ docker_image_watchtower_name }}'
Update containers that have a com.centurylinklabs.watchtower.enable label set to true.
docker_container_watchtower_label_enable: 'false'
Dictionary of key value pairs for container labels.
Example:
docker_container_watchtower_labels:
traefik.enable: "true"
docker_container_watchtower_labels: {}
The maximum log level that will be written to STDERR (shown in docker log when used in a container).
docker_container_watchtower_log_level: info
Will only monitor for new images, send notifications and invoke the pre-check/post-check hooks, but will not update the containers.
docker_container_watchtower_monitor_only: 'true'
Name for the container
docker_container_watchtower_name: watchtower
List of networks the container belongs to.
docker_container_watchtower_networks:
- name: '{{ docker_network_watchtower_name }}'
The shoutrrr service URL to be used. This option can also reference a file, in which case the contents of the file are used. Go to https://containrrr.dev/shoutrrr/v0.6/services/overview to learn more about the different service URLs you can use. You can define multiple services by space separating the URLs. Example: smtp://username:password@host:port/?from=fromAddress&to=recipient1[,recipient2,...]
docker_container_watchtower_notification_url: ''
Custom hostname specified in subject/title. Useful to override the operating system hostname
Controls the log level which is used for the notifications. If omitted, the default log level is info. Possible values are: panic, fatal, error, warn, info, debug or trace.
docker_container_watchtower_notifications_level: info
Custom hostname specified in subject/title. Useful to override the operating system hostname
List of ports to publish from the container to the host.
docker_container_watchtower_ports: []
Cron expression in 6 fields (rather than the traditional 5) which defines when and how often to check for new images.
docker_container_watchtower_schedule: '* 1 2 * * *'
Sets the time zone to be used by WatchTower's logs and the optional Cron scheduling argument (--schedule).
docker_container_watchtower_timezone: UTC
Volume mount host directory, where Treafik config files are stored.
docker_container_watchtower_volume_dir: '{{ docker_container__base__volume_dir }}/{{
docker_container_watchtower_name }}'
List of volumes to mount within the container.
docker_container_watchtower_volumes:
- /var/run/docker.sock:/var/run/docker.sock
Repository path and tag for the container image.
docker_image_watchtower_name: containrrr/watchtower:latest
Indicate to always pull the docker image.
docker_image_watchtower_pull: no
Name of the docker network created for watchtower.
docker_network_watchtower_name: '{{ docker_container_watchtower_name }}_backend'
docker-container-prereq-all
Ensure all pre-requisites are installed
docker-container-prereq-watchtower
Ensure all pre-requisites for watchtower are installed
docker-container-purge-all
Remove all containers and delete volume mounts.
docker-container-purge-watchtower
Remove watchtower and delete volume mounts.
docker-container-remove-all
Remove all containers.
docker-container-remove-watchtower
Remove watchtower.
docker-container-setup-all
Run setup task for all containers.
docker-container-setup-watchtower
Run setup task for watchtower.
never
None.
license (GPL-2.0-or-later, MIT, etc)
andif888