mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-07 08:54:04 +01:00
portainer and traefik ansible playbooks
This commit is contained in:
parent
ebab652abf
commit
356872bbc5
27
ansible/provisoning/ubuntu/deploy-portainer.yaml
Normal file
27
ansible/provisoning/ubuntu/deploy-portainer.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
- hosts: all
|
||||
|
||||
become: yes
|
||||
become_user: "{{ lookup('env','USER') }}"
|
||||
tasks:
|
||||
|
||||
# Create Portainer Volume
|
||||
# --
|
||||
#
|
||||
- name: Create new Volume
|
||||
community.docker.docker_volume:
|
||||
name: portainer-data
|
||||
|
||||
# Deploy Portainer
|
||||
# --
|
||||
#
|
||||
- name: Deploy Portainer
|
||||
community.docker.docker_container:
|
||||
name: portainer
|
||||
image: "docker.io/portainer/portainer-ce"
|
||||
ports:
|
||||
- "9443:9443"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- portainer-data:/data
|
||||
restart_policy: always
|
46
ansible/provisoning/ubuntu/deploy-traefik.yaml
Normal file
46
ansible/provisoning/ubuntu/deploy-traefik.yaml
Normal file
@ -0,0 +1,46 @@
|
||||
---
|
||||
- hosts: all
|
||||
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
|
||||
# Create Directory
|
||||
# ---
|
||||
#
|
||||
# - name: Create directory
|
||||
# file:
|
||||
# path: /etc/traefik
|
||||
# state: directory
|
||||
|
||||
# Create Directory
|
||||
# ---
|
||||
#
|
||||
# - name: Create directory2
|
||||
# file:
|
||||
# path: /etc/traefik/certs
|
||||
# state: directory
|
||||
|
||||
# Copy File
|
||||
# ---
|
||||
#
|
||||
# - name: Copy config file
|
||||
# ansible.builtin.copy:
|
||||
# src: config/traefik.yaml
|
||||
# dest: /etc/traefik/traefik.yaml
|
||||
|
||||
# Deploy Traefik
|
||||
# --
|
||||
#
|
||||
- name: Deploy Traefik
|
||||
become_user: "{{ lookup('env','USER') }}"
|
||||
community.docker.docker_container:
|
||||
name: traefik
|
||||
image: "traefik:v2.5"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /etc/traefik:/etc/traefik
|
||||
restart_policy: always
|
Loading…
Reference in New Issue
Block a user