Skip to content

Commit

Permalink
Feature: restart policy and labels
Browse files Browse the repository at this point in the history
 - add support to define container's restart policy
 - add support to add labels to container (resolves: #4)
  • Loading branch information
till committed Jan 10, 2019
1 parent 14e2b84 commit 82355e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ configure_registry: false
remove_persistent_data: false
remove_existing_container: false
persistent_data_path: /opt/portainer:/data
container_labels: {}
container_restart_policy: always
auth_method: 1

# Portainer version
Expand Down
5 changes: 3 additions & 2 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
docker_container:
name: portainer
image: "portainer/portainer:{{ version }}"
labels: "{{ container_labels | default(omit) }}"
state: started
detach: true
recreate: yes
restart_policy: always
restart_policy: "{{ container_restart_policy }}"
published_ports:
- "{{ host_port }}:9000"
volumes:
Expand All @@ -16,4 +17,4 @@
- name: Wait for container
wait_for:
port: "{{ host_port }}"
host: "{{ inventory_hostname }}"
host: "{{ inventory_hostname }}"

0 comments on commit 82355e5

Please sign in to comment.