Yamllint FTW

This commit is contained in:
Dave Stephens 2021-02-21 19:50:07 +00:00
parent a2976d73e6
commit c8e887207d
76 changed files with 178 additions and 186 deletions

1
.github/FUNDING.yml vendored
View file

@ -1 +1,2 @@
---
ko_fi: davestephens

View file

@ -1,5 +1,4 @@
# This is a basic workflow to help you get started with Actions
---
name: CI
# Controls when the action will run.
@ -30,5 +29,7 @@ jobs:
- name: Install test dependencies
run: pip3 install yamllint ansible-lint==4.3.7
- name: Ansible lint
run: ansible-lint ./nas.yml -x 106,208
- name: Linting
run: |
ansible-lint ./nas.yml -x 106,208
yamllint .

View file

@ -1,5 +1,4 @@
# This is a basic workflow to help you get started with Actions
---
name: Integration
# Controls when the action will run.
@ -8,7 +7,6 @@ on:
workflow_dispatch:
jobs:
test:
name: Test
runs-on: ubuntu-20.04

1
.gitignore vendored
View file

@ -4,6 +4,7 @@ site
*.retry
*.log
inventories
.cache
# Vim
[._]sw[a-p]

16
.yamllint Normal file
View file

@ -0,0 +1,16 @@
---
extends: default
rules:
line-length: disable
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
comments:
min-spaces-from-content: 1
braces:
min-spaces-inside: 0
max-spaces-inside: 1
ignore: |
.cache
.github/workflows/*.yml

View file

@ -1,24 +1,15 @@
---
apiVersion: 1
providers:
# <string> an unique provider name
- name: 'Ansible-NAS Dashboards'
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string, required> name of the dashboard folder. Required
folder: 'Ansible-NAS'
# <string> folder UID. will be automatically generated if not specified
folderUid: ''
# <string, required> provider type. Required
type: file
# <bool> disable dashboard deletion
disableDeletion: false
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 60
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: false
options:
# <string, required> path to dashboard files on disk. Required
path: /var/lib/grafana/dashboards/ansible-nas
- name: 'Ansible-NAS Dashboards'
orgId: 1
folder: 'Ansible-NAS'
folderUid: ''
type: file
disableDeletion: false
editable: true
updateIntervalSeconds: 60
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards/ansible-nas

View file

@ -1,3 +1,4 @@
---
## ._____. .__
## _____ ____ _____|__\_ |__ | | ____ ____ _____ ______
## \__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/

View file

@ -1,3 +1,4 @@
---
## ._____. .__
## _____ ____ _____|__\_ |__ | | ____ ____ _____ ______
## \__ \ / \ / ___/ || __ \| | _/ __ \ ______ / \\__ \ / ___/
@ -15,4 +16,3 @@ ansible_nas_timezone: Etc/UTC
## Enable some applications
heimdall_enabled: true
portainer_enabled: true

View file

@ -1,3 +1,4 @@
---
# Project information
site_name: 'Ansible-NAS'
site_description: 'Build a fully functional NAS with an Ubuntu box and this playbook'

102
nas.yml
View file

@ -254,70 +254,70 @@
when: (znc_enabled | default(False))
tasks:
- import_tasks: tasks/thelounge.yml
when: (thelounge_enabled | default(False))
tags: thelounge
- import_tasks: tasks/thelounge.yml
when: (thelounge_enabled | default(False))
tags: thelounge
- import_tasks: tasks/glances.yml
when: (glances_enabled | default(False))
tags: glances
- import_tasks: tasks/glances.yml
when: (glances_enabled | default(False))
tags: glances
- import_tasks: tasks/gitlab.yml
when: (gitlab_enabled | default(False))
tags: gitlab
- import_tasks: tasks/gitlab.yml
when: (gitlab_enabled | default(False))
tags: gitlab
- import_tasks: tasks/timemachine.yml
when: (timemachine_enabled | default(False))
tags: timemachine
- import_tasks: tasks/timemachine.yml
when: (timemachine_enabled | default(False))
tags: timemachine
- import_tasks: tasks/stats.yml
when: (stats_enabled | default(False))
tags: stats
- import_tasks: tasks/stats.yml
when: (stats_enabled | default(False))
tags: stats
- import_tasks: tasks/guacamole.yml
when: (guacamole_enabled | default(False))
tags: guacamole
- import_tasks: tasks/guacamole.yml
when: (guacamole_enabled | default(False))
tags: guacamole
- import_tasks: tasks/joomla.yml
when: (joomla_enabled | default(False))
tags: joomla
- import_tasks: tasks/joomla.yml
when: (joomla_enabled | default(False))
tags: joomla
- import_tasks: tasks/wallabag.yml
when: (wallabag_enabled | default(False))
tags: wallabag
- import_tasks: tasks/wallabag.yml
when: (wallabag_enabled | default(False))
tags: wallabag
- import_tasks: tasks/mosquitto.yml
when: (mosquitto_enabled | default(False))
tags: mosquitto
- import_tasks: tasks/mosquitto.yml
when: (mosquitto_enabled | default(False))
tags: mosquitto
- import_tasks: tasks/calibre.yml
when: (calibre_enabled | default(False))
tags: calibre
- import_tasks: tasks/calibre.yml
when: (calibre_enabled | default(False))
tags: calibre
- import_tasks: tasks/openhab.yml
when: (openhab_enabled | default(False))
tags: openhab
- import_tasks: tasks/openhab.yml
when: (openhab_enabled | default(False))
tags: openhab
- import_tasks: tasks/jellyfin.yml
when: (jellyfin_enabled | default(False))
tags: jellyfin
- import_tasks: tasks/jellyfin.yml
when: (jellyfin_enabled | default(False))
tags: jellyfin
- import_tasks: tasks/krusader.yml
when: (krusader_enabled | default(False))
tags: krusader
- import_tasks: tasks/krusader.yml
when: (krusader_enabled | default(False))
tags: krusader
- import_tasks: tasks/ubooquity.yml
when: (ubooquity_enabled | default(False))
tags: ubooquity
- import_tasks: tasks/ubooquity.yml
when: (ubooquity_enabled | default(False))
tags: ubooquity
- import_tasks: tasks/youtubedlmaterial.yml
when: (youtubedlmaterial_enabled | default(False))
tags: youtubedlmaterial
- import_tasks: tasks/youtubedlmaterial.yml
when: (youtubedlmaterial_enabled | default(False))
tags: youtubedlmaterial
- import_tasks: tasks/virtual_desktop.yml
when: (virtual_desktop_enabled | default(False))
tags: virtual_desktop
- import_tasks: tasks/virtual_desktop.yml
when: (virtual_desktop_enabled | default(False))
tags: virtual_desktop
- import_tasks: tasks/pytivo.yml
when: (pytivo_enabled | default(False))
tags: pytivo
- import_tasks: tasks/pytivo.yml
when: (pytivo_enabled | default(False))
tags: pytivo

View file

@ -17,5 +17,3 @@
mode: "u=rwX,g=rwX,o=rX"
recurse: true
loop: "{{ samba_shares }}"

View file

@ -29,4 +29,3 @@
traefik.http.routers.airsonic.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.airsonic.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.airsonic.loadbalancer.server.port: "4040"

View file

@ -40,8 +40,8 @@
- name: Restart Docker
service:
name: docker
state: restarted
name: docker
state: restarted
when: docker_config.changed
tags:
- skip_ansible_lint

View file

@ -1,3 +1,4 @@
---
- name: Create Bitwarden Directories
file:
path: "{{ item }}"
@ -28,7 +29,6 @@
traefik.hub.port: "bitwarden_port_b"
traefik.hub.protocol: "ws"
restart_policy: unless-stopped
#memory: 1g
- name: Bitwarden Backup Container
docker_container:

View file

@ -1,3 +1,4 @@
---
auth:
scopedToken: "{{ cloudflare_token }}"
domains:

View file

@ -1,3 +1,4 @@
---
- name: Create Emby Directories
file:
path: "{{ item }}"

View file

@ -1,3 +1,4 @@
---
- name: Create get_iplayer Directories
file:
path: "{{ item }}"
@ -18,4 +19,3 @@
- "{{ get_iplayer_port }}:8181"
restart_policy: unless-stopped
memory: "{{ get_iplayer_memory }}"

View file

@ -47,7 +47,7 @@
image: gitea/gitea:1.6
pull: true
links:
- gitea-mysql:db
- gitea-mysql:db
volumes:
- "{{ gitea_data_directory }}/gitea:/data:rw"
ports:

View file

@ -1,3 +1,4 @@
---
- name: Create Home Assistant Directories
file:
path: "{{ item }}"

View file

@ -25,7 +25,7 @@
image: miniflux/miniflux:latest
pull: true
links:
- miniflux-postgres:db
- miniflux-postgres:db
ports:
- "{{ miniflux_port }}:8080"
env:

View file

@ -1,3 +1,4 @@
---
n8n_enabled: false
# Networking

View file

@ -1,3 +1,4 @@
---
netdata_enabled: false
netdata_available_externally: "false"

View file

@ -28,7 +28,7 @@
image: nextcloud:14
pull: true
links:
- nextcloud-mysql:mysql
- nextcloud-mysql:mysql
volumes:
- "{{ nextcloud_data_directory }}/nextcloud:/var/www/html:rw"
ports:
@ -48,4 +48,3 @@
traefik.http.routers.nextcloud.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.nextcloud.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.nextcloud.loadbalancer.server.port: "80"

View file

@ -1,4 +1,3 @@
---
- name: Create Ombi Directories
file:

View file

@ -33,7 +33,5 @@ plex_memory: "2g"
# plex_devices:
# - "/dev/dri:/dev/dri"
# see https://hub.docker.com/r/linuxserver/plex for details on this setting
plex_version: "docker"

View file

@ -1,3 +1,4 @@
---
- name: Create Tautulli Directories
file:
path: "{{ item }}"

View file

@ -1,3 +1,4 @@
---
- name: Create Calibre-web Directories
file:
path: "{{ item }}"

View file

@ -1,3 +1,4 @@
---
- name: Glances Docker Container
docker_container:
name: glances
@ -7,7 +8,6 @@
- "{{ glances_port_one }}:61208"
- "{{ glances_port_two }}:61209"
volumes:
#- "/glances.conf:/glances/conf/glances.conf"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/etc/timezone:/etc/timezone:ro"
pid_mode: host

View file

@ -1,3 +1,4 @@
---
- name: Create Jellyfin Directories
file:
path: "{{ item }}"

View file

@ -1,4 +1,3 @@
---
- name: Krusader Directory
file:

View file

@ -1,3 +1,4 @@
---
- name: Create Mosquitto Directories
file:
path: "{{ item }}"

View file

@ -33,4 +33,3 @@
traefik.http.routers.thelounge.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.thelounge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.thelounge.loadbalancer.server.port: "9000"

View file

@ -1,3 +1,4 @@
---
- name: Create Wallabag Directories
file:
path: "{{ item }}"

View file

@ -1,4 +1,3 @@
---
- name: YouTubeDL-Material Directory
file:

View file

@ -1,43 +1,25 @@
# config file version
---
apiVersion: 1
# list of datasources to insert/update depending
# whats available in the database
datasources:
# <string, required> name of the datasource. Required
- name: InfluxDB
# <string, required> datasource type. Required
type: influxdb
# <string, required> access mode. direct or proxy. Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8086
# <string> database password, if used
password:
# <string> database user, if used
user:
# <string> database name, if used
database: telegraf
# <bool> enable/disable basic auth
basicAuth:
# <string> basic auth username
basicAuthUser:
# <string> basic auth password
basicAuthPassword:
# <bool> enable/disable with credentials headers
withCredentials:
# <bool> mark as default datasource. Max one per org
isDefault: true
# <map> fields that will be converted to json and stored in json_data
jsonData:
timeInterval: "15s"
# <string> json object of data that will be encrypted.
secureJsonData:
tlsCACert: "..."
tlsClientCert: "..."
tlsClientKey: "..."
version: 1
# <bool> allow users to edit datasources from the UI.
editable: false
- name: InfluxDB
type: influxdb
access: proxy
orgId: 1
url: http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8086
password:
user:
database: telegraf
basicAuth:
basicAuthUser:
basicAuthPassword:
withCredentials:
isDefault: true
jsonData:
timeInterval: "15s"
secureJsonData:
tlsCACert: "..."
tlsClientCert: "..."
tlsClientKey: "..."
version: 1
editable: false

View file

@ -23,7 +23,7 @@ neutral='\033[0m'
timestamp=$(date +%s)
# Allow environment variables to override defaults.
distro=${distro:-"ubuntu1804"}
distro=${distro:-"ubuntu2004"}
docker_owner=${docker_owner:-"geerlingguy"}
playbook=${playbook:-"nas.yml"}
cleanup=${cleanup:-"true"}