add pihole

pull/29/head
Cian Hatton 3 years ago
parent 08cc78dd66
commit cff95e0e44

@ -60,7 +60,7 @@
"name": "plugins/modules/portainer_stack.py", "name": "plugins/modules/portainer_stack.py",
"ftype": "file", "ftype": "file",
"chksum_type": "sha256", "chksum_type": "sha256",
"chksum_sha256": "8d7c6e609e3d6d1764768c479a07375b8b43d65a9fc30e7f8cefe1bc48fe7d2b", "chksum_sha256": "e75fa1655aed9c13955315a80aa9a3f0b54ac1bc386697756bb308e0cfe4ecbb",
"format": 1 "format": 1
}, },
{ {

@ -23,7 +23,7 @@
"name": "FILES.json", "name": "FILES.json",
"ftype": "file", "ftype": "file",
"chksum_type": "sha256", "chksum_type": "sha256",
"chksum_sha256": "af38f629ca55ff7f83f84e54ee9496e2fdcd93eb6afce03d79f12dd7d68a5153", "chksum_sha256": "a3d632538c4fb62677f3dceb2b32648f6688932bfa4354ad1ad21ecd1e031a7d",
"format": 1 "format": 1
}, },
"format": 1 "format": 1

@ -140,7 +140,7 @@ def handle_state_present(client, module):
target_stack_name = module.params["stack_name"] target_stack_name = module.params["stack_name"]
for stack in stacks: for stack in stacks:
if stack["Name"] == target_stack_name: if stack["Name"] == target_stack_name and int(stack["EndpointId"]) == module.params["endpoint_id"]:
already_exists = True already_exists = True
result["stack_id"] = stack["Id"] result["stack_id"] = stack["Id"]
break break

@ -15,6 +15,8 @@ mounts:
configure_samba: true configure_samba: true
portainer_host: true portainer_host: true
cron_hour: "5"
devices: devices:
- uuid: a54c1bde-1400-4975-bf24-08c603ca3a11 # /dev/sdc1 - uuid: a54c1bde-1400-4975-bf24-08c603ca3a11 # /dev/sdc1
path: /mnt/data/device0 path: /mnt/data/device0
@ -47,7 +49,10 @@ services:
template_vars: template_vars:
default_network: mariadb_net default_network: mariadb_net
- name: dashboards - name: dashboards
template_vars: {} template_vars:
dashy: true
dashdot: true
glances: true
- name: nginx-proxy-manager - name: nginx-proxy-manager
template_vars: {} template_vars: {}
- name: plex - name: plex
@ -64,3 +69,4 @@ services:
default_network: mariadb_net default_network: mariadb_net
- name: olivetin - name: olivetin
template_vars: {} template_vars: {}
- name: pihole

@ -5,5 +5,13 @@ portainer_endpoint: 23
services: services:
- name: linkding - name: linkding
template_vars: {} template_vars: {}
- name: pihole
- name: dashboards
template_vars:
dashy: false
dashdot: true
glances: true
ansible_pull_path: /usr/local/bin/ansible-pull ansible_pull_path: /usr/local/bin/ansible-pull
cron_hour: "4"

@ -22,35 +22,35 @@
mode: '0755' mode: '0755'
with_items: "{{ portainer_stack_directories }}" with_items: "{{ portainer_stack_directories }}"
- name: "Stack {{ portainer_stack_name }} | Find docker volumes" #- name: "Stack {{ portainer_stack_name }} | Find docker volumes"
ansible.builtin.shell: docker volume ls -f name={{ portainer_stack_name }} --format '{{ '{{' }} .Name {{ '}}' }}' # ansible.builtin.shell: docker volume ls -f name={{ portainer_stack_name }} --format '{{ '{{' }} .Name {{ '}}' }}'
register: find_volumes # register: find_volumes
changed_when: false # changed_when: false
- name: "Stack {{ portainer_stack_name }} | Find docker volumes that need to be restored" #- name: "Stack {{ portainer_stack_name }} | Find docker volumes that need to be restored"
ansible.builtin.script: scripts/find-volumes-to-restore.py # ansible.builtin.script: scripts/find-volumes-to-restore.py
environment: # environment:
EXISTING_VOLUMES: "{{ find_volumes.stdout_lines }}" # EXISTING_VOLUMES: "{{ find_volumes.stdout_lines }}"
STACK_NAME: '{{ portainer_stack_name }}' # STACK_NAME: '{{ portainer_stack_name }}'
DOCKER_COMPOSE_DIR: '{{ directories.docker_compose_directory }}' # DOCKER_COMPOSE_DIR: '{{ directories.docker_compose_directory }}'
args: # args:
executable: python3 # executable: python3
register: python_output # register: python_output
changed_when: false # changed_when: false
- name: "Stack {{ portainer_stack_name }} | Build list of volumes to restore." #- name: "Stack {{ portainer_stack_name }} | Build list of volumes to restore."
ansible.builtin.set_fact: # ansible.builtin.set_fact:
restore_volumes: "{{ restore_volumes | default([]) + [{'volume_name':item}] }}" # restore_volumes: "{{ restore_volumes | default([]) + [{'volume_name':item}] }}"
with_items: "{{ python_output.stdout_lines | list }}" # with_items: "{{ python_output.stdout_lines | list }}"
- name: "Stack {{ portainer_stack_name }} | Restore any missing volumes from S3" #- name: "Stack {{ portainer_stack_name }} | Restore any missing volumes from S3"
ansible.builtin.include_role: # ansible.builtin.include_role:
name: chatton.docker_backup.docker_s3_volume_restore # name: chatton.docker_backup.docker_s3_volume_restore
when: restore_volumes is defined # when: restore_volumes is defined
vars: # vars:
docker_backup_restore_force: false # docker_backup_restore_force: false
docker_backup_restore_latest_s3_key: true # docker_backup_restore_latest_s3_key: true
docker_backup_s3_restores: "{{ restore_volumes }}" # docker_backup_s3_restores: "{{ restore_volumes }}"
- name: "Stack {{ portainer_stack_name }} | Update Portainer." - name: "Stack {{ portainer_stack_name }} | Update Portainer."
chatton.portainer.portainer_stack: chatton.portainer.portainer_stack:

@ -29,6 +29,24 @@ sections:
- title: Glances - title: Glances
icon: hl-glances icon: hl-glances
url: http://qnap:8083 url: http://qnap:8083
- title: Pihole
icon: hl-pihole
url: http://qnap:85/admin
- name: Snunmu Dashboards
widgets:
- type: gl-disk-space
options:
hostname: http://snunmu:8083
items:
- title: Dash Dot
icon: hl-dashdot
url: http://snunmu:3010
- title: Glances
icon: hl-glances
url: http://snunmu:8083
- title: Pihole
icon: hl-pihole
url: http://snunmu:85/admin
- name: Media Stack - name: Media Stack
items: items:
- title: Plex - title: Plex
@ -64,7 +82,7 @@ sections:
- title: Linkding - title: Linkding
description: Manager photos description: Manager photos
icon: hl-linkding icon: hl-linkding
url: http://qnap:9090 url: http://snunmu:9090
- title: Nextcloud - title: Nextcloud
icon: hl-nextcloud icon: hl-nextcloud
url: http://qnap:8081 url: http://qnap:8081

@ -29,6 +29,7 @@
owner: root owner: root
group: root group: root
mode: 0440 mode: 0440
ignore_errors: true
notify: notify:
- restart-dashy - restart-dashy
@ -69,7 +70,7 @@
name: backup docker volumes (nightly) name: backup docker volumes (nightly)
weekday: "*" weekday: "*"
minute: "0" minute: "0"
hour: "4" hour: "{{ cron_hour }}"
user: "{{ homelab_user }}" user: "{{ homelab_user }}"
job: > job: >
{{ ansible_pull_path }} {{ ansible_pull_path }}

@ -1,6 +1,7 @@
--- ---
version: '3.5' version: '3.5'
services: services:
{% if template_vars.dashdot %}
dash-dot: dash-dot:
container_name: dashdot container_name: dashdot
image: mauricenino/dashdot:latest image: mauricenino/dashdot:latest
@ -10,7 +11,8 @@ services:
- '3010:3001' - '3010:3001'
volumes: volumes:
- /:/mnt/host:ro - /:/mnt/host:ro
{% endif %}
{% if template_vars.dashy %}
dashy: dashy:
container_name: dashy container_name: dashy
image: lissy93/dashy image: lissy93/dashy
@ -35,7 +37,8 @@ services:
timeout: 10s timeout: 10s
retries: 3 retries: 3
start_period: 40s start_period: 40s
{% endif %}
{% if template_vars.glances %}
glances: glances:
image: nicolargo/glances:latest-alpine image: nicolargo/glances:latest-alpine
restart: always restart: always
@ -46,3 +49,4 @@ services:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
environment: environment:
- "GLANCES_OPT=-w" - "GLANCES_OPT=-w"
{% endif %}

@ -0,0 +1,21 @@
---
version: "3"
services:
pihole:
container_name: pihole
image: "pihole/pihole:2022.09.2"
ports:
- "53:53/tcp"
- "53:53/udp"
- "85:80/tcp"
environment:
WEBPASSWORD: '{{ pihole_web_password }}'
DNSMASQ_LISTENING: "all"
volumes:
- '{{ inventory_hostname_short }}_app:/etc/pihole'
- '{{ inventory_hostname_short }}_dns:/etc/dnsmasq.d'
restart: unless-stopped
volumes:
"{{ inventory_hostname_short }}_app":
"{{ inventory_hostname_short }}_dns":

@ -1,53 +1,56 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
65643763356433316330636633643166346433393961353439313166383463363438373765656365 36366133663433613231613961343232323738393961386166343066373337333633313564653266
3831643632336537663761363438656264376632663732630a363132303066376262656132643839 3465326438343038323338653835363837323863663735370a333936383738303331366431636462
66633061633861383139343235376237336266383666373532333433306336396537643363633238 35373964653835303530336139303163383162363164313333356535666339393231633461313162
6633373336633139350a303762356261333830323934663565393630336139393032643239633932 3861663065633736620a306437666563616266386439373464643635396632633164623066613362
65373337663435333031656632366263303235393561613738376634316639303831343638386365 63666666306634326638346466646635353333623730303136353761363439396631346665643134
61623132663331643833343864656332613532333833626532623037623734633039663931376466 61656133323461346639623534633331623533663430643739346261623766343933643937393263
62326137373563356261363735616435656261633335383137393562386132393237356366343038 65313431613064333361363165653632343462636262396435306666326136313139313837313539
62343561653362646635373766313537326136656537366631643662613565323934653062353032 34313939633538613661393065656438306537343863653135316530636133373933363638316332
38616638626465303666626466303064336564653138663731336435616531633631333433353730 64333738633332313233383833393932613535613037373637393236383835333363626332353763
39313666373938333765373535653233373766316337386361663233393438623334386535386662 31316163343633363463386465616439313661663236663734623438653262643831613932646561
39383261633964326433363538666561373762643837656534366233313932376135363766616266 30633034633364616338343463366233376663613536623865663036353333656366393134396332
39353831306536633133383064623230376238326336303932353535336239373761313062656435 39666666343963373539656665306366643736393962323138333636656366623666396638643662
37383833373434656534623763613430663237383033656538653735646635303265306363316361 32666533356661306137663037663563393634333166353938623434663563366466656463666334
35393132303137666562396535366132653532393039633138653736363631306135613336623139 39373831303835636331636235616361323435646434653638663561353161633037396634353863
37663839613164626332366131303335636534626132313238316633326635666134336665323233 66333065386439376537653530323431343834346636663564333835373635356233396334356438
30333436323830383737356566363364626339313438323963336130613964376566376135633566 61383537653533326565393536623639636434323934376537343030643364333134353731396438
38313464313437333931386633316265613261643532656262366566633437373963376136323038 31333766383063353630363465323330376139646537356165666361323036376535663433643865
62313231393134643464316565623765656436643964313865373732343561356530316536323631 38353461393937313833623263356134313935666639333032653434333739393438656561313138
65626162393461343634383931313239353866633565653830333661336263323638333364623166 64366434376637353139376566623764393562663134353330313162656239653064363136333363
64396532643861613539636263393239623938353239616432333263306639333563616138386631 30383266646331363338326633383263643739323031393766653833356130353366356535373361
61373763326330623064323461336330653762316266303165313434366531663638666263653262 36633261386336316361653433663637373034623963646561323132613066653337313031326563
35343834343361613562373831383565303364613631666432613436656564396536633334353338 63313962343730613436323966323562633563323664656234303064346666303164623831356561
63353633326631386333663564643234323266623237323064663563633961376335396161306662 31613664303331633830393165383135373563626261363930363362336131623965373136396634
38616538326338353362333364653339626464323432656466616337326662626439313537396330 38316232653739393439386133306338626462343566633330363336363238346562323561373237
61303066376666643035633037623736373337316639623532306363356362393163393234346235 66653831396135653032366637323839316533323661633264656432663039303737336535376635
63346366323830383365666466333064303533386530646637633038623766306161353933393635 32353064613964303738393936373561626661316662336634663637383465646337633964636364
64366336303762623662373964366264373662616637373133343864636666616337303638353831 30336166393463343664343062366532656365636634313766613766313132623962376665306439
31386166633864343938396465366530346539303932393239613237333863363034306364373230 31386133623734626338326165623762396338386134346364373336616139616330386166303433
36363563356136623232616539383934336163333563663033613963646431336663613966393635 32373338326366623237346561396663373839313833666238393937333937396231326465653939
34376334633035376333373366653262313333653966643134393265346131336565646132303166 35333439323439626332616461363165313732366434333462373464343338356230353630636139
39373232623565663438353861306463333034393463383732326163376231343364313466623137 61323837376134343061353666356531316565616539646162313964336334653237626431643034
38366264366530613563386132636135626530323339303531316432313234366466303939323565 35386664383030373037333537383437336234646136643233366339626266666233643563333965
62623235356334316336336335613436373434356133643263303366323537353364326633383465 30336364613566303634653530386136656239383763636338346436653833653434306438346534
65316435343530303365396664613034323038303866653434643562346531663635323032646136 65393131306365663837366365656335643763616162643064356561386635383064353339626335
31623539396265653434646133313635636437646261636134643333386635323266356432346165 31393438373137363937346236343035633363316661663637393661613066343862313464306165
37646136616233346138386639326666643237303930663630643733333563623533313866306532 30306561326131383336346263366637396362646138313136633466333833663033363961633466
65633132613739353434366564366433353034336466323265666432356563646430396165643133 31343439353863343264306238633064623763343863343564383163653639303164363461346437
31336361323938653031393462653533666332626439336135393262663633386162306566383232 33616433656566653065343932386466343436313531363263306637383235353666666233363666
30396533613866623338373366643665346162666265633765333062356235363331363737333535 62656537303237323034613731343561323766613336363064346334366263663737646132393130
30343036663130633031666533623335613234353933386635663866343662333931396363356162 36323466323262323937396137366161383066323537353136323832633066383866336365316535
64646431373936373935383066653561383866353531303937356361616664363237633238376235 37653530323365656633643837666538316537323033613431333839303133326337393233643238
66313962313965663931393363363639343061613161353038343933326433386264656563393838 30393630643439653733373733393330366466386564646431643232376234373734316637656130
31656439316432626631346265646262333235666362666639303863633166333331623064323835 34303262633331643736396635663232653332366366616636346539666430313266363736303036
64613362376362353537383035646164313862333836386132646239373734626538366163663966 66376530323538323439313834326262343234633361626130303535313162306365616265323131
30616433346662626664653132396638383966303065626432316665396463663935343731363033 32353663396434636134663033396264383061323637356438363362626332363163393734386531
61323036623239616136636235666463643433646632396465633234393438623938313261376364 62666365633335303264393230303730613731376433613462306464393836626434613961656430
32623463633036653339316138323130623634626266373666303935353332356564363835343662 31393761316666656637633666316335356433643966363565633934393133653166333731333930
64333134353234383935306439393031363833353237366131326265646433383862336163623138 31653430656365376133643964336237353064636533313135313965333738386365373638623138
34316333396135313863393139383462616130393939366337353737636231656436316463666265 65313432386463336338356134373564633938376233343361623932626264623938373333616536
65376166366338373437336436303835333831663062663039313934613732313563346538643565 64333361376165396665373163316666383830653262343732306536623432353065626532663731
32336131306265633462343333623066656466313435303961313565333130613732373366313639 63623434613866346532396564303634653565386661363838366339333338353633363437323636
66393163396365666431 37346331323836333561666165393661353730646164636233343362333334626133333934616462
66303532636436646632626632326632353732633833653330326632666538363334303965373262
38343639303730316235313538333636313438346130386535313334373434333239393366383661
373434663138393331353436313837313765

Loading…
Cancel
Save