diff --git a/playbook.yml b/playbook.yml index 18a33bc5..49b352ff 100644 --- a/playbook.yml +++ b/playbook.yml @@ -25,6 +25,7 @@ - websites - ouroboros - mailu + - portainer smtp_host: "postfix" smtp_port: "587" diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index 1660a0d2..566ababa 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -65,3 +65,7 @@ mailu: subnet: 192.168.203.0/24 volume_folder: "{{ volume_root_folder }}/mailu" +portainer: + domain: "portainer.{{ base_domain }}" + volume_folder: "{{ volume_root_folder }}/portainer" + diff --git a/roles/docker/tasks/services/portainer.yml b/roles/docker/tasks/services/portainer.yml new file mode 100644 index 00000000..b13dcff7 --- /dev/null +++ b/roles/docker/tasks/services/portainer.yml @@ -0,0 +1,23 @@ +--- + +- name: create portainer volume folder + file: + name: "{{ portainer.volume_folder }}" + state: directory + +- name: run portainer + docker_container: + name: portainer + image: portainer/portainer + restart_policy: always + networks: + - name: external_services + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - "{{ portainer.volume_folder }}:/data" + published_ports: + - 9001:9000 + env: + VIRTUAL_HOST: "{{ portainer.domain }}" + LETSENCRYPT_HOST: "{{ portainer.domain }}" + LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"