Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
80 Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
veerendra2 committed Oct 8, 2023
1 parent a40e206 commit 776e0c4
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 111 deletions.
9 changes: 9 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
---
verbosity: 1

skip_list:
- 'yaml'
- 'role-name'
- 'package-latest'
- 'latest[git]'
- 'no-changed-when'
- 'schema[meta]'
- 'ignore-errors'
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

19 changes: 10 additions & 9 deletions inventory.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
all:
# hosts:
# atom:
# ansible_ssh_port: 22
# ansible_ssh_host: 192.168.0.120
# ansible_ssh_user: veerendra
# # ansible_ssh_password:
# extra_hosts:
# - "atom:192.168.0.130" # Wifi Address
hosts:
atom:
ansible_ssh_port: 22
ansible_ssh_host: 192.168.0.120
ansible_ssh_user: veerendra
# ansible_ssh_password:
extra_hosts:
- "atom:192.168.0.130"
localhost:
ansible_connection: local
ansible_connection: local
10 changes: 3 additions & 7 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
vars_files:
- vars.yml

roles:
- role: veerendra2.prepare_dev_setup
tags: system
# roles:
# - role: veerendra2.prepare_dev_setup
# tags: system

tasks:
- name: Prepare Pi
Expand All @@ -22,7 +22,3 @@
- name: Setup firewall rules
ansible.builtin.import_tasks: tasks/ufw.yml
become: true

- name: Run smoke tests
ansible.builtin.import_tasks: tasks/smoke-tests.yml
tags: never
12 changes: 6 additions & 6 deletions services/databases/docker-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ services:
labels:
- "traefik.enable=false"
hostname: redis
command: [
"sh", "-c",
'
docker-entrypoint.sh
--requirepass "$$(cat $$REDIS_PASSWORD_FILE)"
'
command: [
"sh", "-c",
'
docker-entrypoint.sh
--requirepass "$$(cat $$REDIS_PASSWORD_FILE)"
'
]
env_file:
- .env_redis
Expand Down
1 change: 0 additions & 1 deletion services/filebrowser/docker-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ services:
- /media/disk1:/srv/disk1
networks:
network_public:

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: 1

providers:
Expand All @@ -9,4 +10,4 @@ providers:
editable: true
allowUiUpdates: true
options:
path: /etc/grafana/provisioning/dashboards
path: /etc/grafana/provisioning/dashboards
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: 1

datasources:
Expand Down
5 changes: 3 additions & 2 deletions services/monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
global:
scrape_interval: 15s
evaluation_interval: 15s
Expand All @@ -8,8 +9,8 @@ global:
monitor: "docker-host-alpha"

# Load and evaluate rules in this file every 'evaluation_interval' seconds.
#rule_files:
# - "alert.rules"
# rule_files:
# - "alert.rules"

# A scrape configuration containing exactly one endpoint to scrape.
scrape_configs:
Expand Down
1 change: 0 additions & 1 deletion services/portainer/docker-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ services:
- network_public
secrets:
- portainer_admin_password

3 changes: 2 additions & 1 deletion services/rest-server/docker-stack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: "3.8"

networks:
Expand Down Expand Up @@ -37,4 +38,4 @@ services:
- network_public
- network_monitoring
secrets:
- htpasswd
- htpasswd
1 change: 1 addition & 0 deletions services/searxng/config/settings.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
general:
# Debug mode, only for development. Is overwritten by ${SEARXNG_DEBUG}
debug: false
Expand Down
1 change: 1 addition & 0 deletions services/searxng/docker-stack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: "3.8"

networks:
Expand Down
3 changes: 2 additions & 1 deletion services/traefik/docker-stack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# https://dust6765.gitbook.io/raspberrypi-home-server/services/traefik-proxy
version: "3.8"

Expand Down Expand Up @@ -51,4 +52,4 @@ services:
- network_public
- network_private
secrets:
- duckdns
- duckdns
1 change: 1 addition & 0 deletions services/traefik/network.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: '3.8'

services:
Expand Down
1 change: 1 addition & 0 deletions services/vaultwarden/docker-stack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: '3.8'

networks:
Expand Down
9 changes: 6 additions & 3 deletions tasks/deploy-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
path: "{{ services_base_dir_location }}"
state: directory
owner: "{{ run_user }}"
become: yes
mode: '0644'
become: true

# Run pre deploy tasks for services
- include_tasks: pihole.yml
- name: Include pihole tasks
ansible.builtin.include_tasks: pihole.yml
when: "'pihole' in services"

- name: Create .vpn_ip file for torrent service
ansible.builtin.copy:
dest: services/torrent/.vpn_ip
content: |
VPN_IP={{ vpn_ip }}
owner: "{{ run_user }}"
mode: '0644'
when: "vpn_ip and 'torrent' in services"

- name: Synchronize services directories
Expand Down
16 changes: 9 additions & 7 deletions tasks/pigpio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
ansible.builtin.get_url:
url: https://github.com/joan2937/pigpio/archive/master.zip
dest: "{{ tempdir.path }}"
owner: "{{ run_user }}"
mode: '0440'
# TODO need to test!
- name: Extract pigpio
ansible.builtin.unarchive:
Expand All @@ -24,7 +26,6 @@

- name: Set systemd unit parameters for pigpiod
ansible.builtin.set_fact:
name: pigpiod
description: Daemon required to control GPIO pins via pigpio
exec_start_cmd: /usr/local/bin/pigpiod
exec_kill_cmd: /bin/systemctl kill pigpiod
Expand All @@ -37,12 +38,13 @@
ansible.builtin.template:
src: templates/systemd_unit.service.j2
dest: /lib/systemd/system/pigpiod.service
mode: '0640'

- name: Enable and start pigpiod systemd daemon
ansible.builtin.systemd:
name: pigpiod
enabled: yes
daemon_reload: yes
enabled: true
daemon_reload: true
state: started

- name: Copy fan.py script
Expand All @@ -53,7 +55,6 @@

- name: Set systemd unit parameters for fan-py
ansible.builtin.set_fact:
name: fan-py
description: Daemon required to control fan speed via pigpio
exec_start_cmd: /usr/bin/python3 /usr/local/bin/fan.py
exec_kill_cmd: /bin/kill -TERM $MAINPID
Expand All @@ -62,14 +63,15 @@
pre_start_cmd: /bin/sleep 5
service_type: simple

- name: Create fan-py systemd unit
- name: Create fan-py systemd unit file
ansible.builtin.template:
src: templates/systemd_unit.service.j2
dest: /lib/systemd/system/fan-py.service
mode: '0640'

- name: Enable and start fan-py systemd daemon
ansible.builtin.systemd:
name: fan-py
enabled: yes
daemon_reload: yes
enabled: true
daemon_reload: true
state: started
14 changes: 7 additions & 7 deletions tasks/pihole.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
# https://github.com/pi-hole/docker-pi-hole#installing-on-ubuntu-or-fedora

- name: Disable stub resolver in systemd-resolved config
ini_file:
community.general.ini_fil:
path: /etc/systemd/resolved.conf
section: Resolve
option: DNSStubListener
value: "no"
backup: true

- name: Create backup /etc/resolv.conf
copy:
remote_src: yes
ansible.builtin.copy`:
remote_src: true
src: /etc/resolv.conf
dest: /etc/resolv.conf.backup

- name: Remove /etc/resolv.conf
file:
ansible.builtin.file:
path: /etc/resolv.conf
state: absent

- name: Create link /etc/resolv.conf
file:
ansible.builtin.file:
src: /run/systemd/resolve/resolv.conf
dest: /etc/resolv.conf
state: link
ignore_errors: yes
ignore_errors: true

- name: Restart systemd-resolved
service:
ansible.builtin.service:
name: systemd-resolved
state: restarted
6 changes: 3 additions & 3 deletions tasks/prepare-pi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- name: Install fan script
when: install_fan_script
block:
- name: Check fan-py daemon is loaded
ansible.builtin.systemd:
Expand All @@ -9,21 +10,20 @@
- name: Install pigpio and Pi fan controller
ansible.builtin.include_tasks: pigpio.yml
when: output.status.LoadState != 'loaded'
when: install_fan_script

- name: Power optimization
when: disable_bluetooth
block:
- name: Stop and disable hciuart and bluetooth deamon
ansible.builtin.systemd:
name: "{{ item }}"
state: stopped
enabled: no
enabled: false
with_items:
- bluetooth
- hciuart
- name: Disable HDMI Output
ansible.builtin.command: /usr/bin/tvservice -o
when: disable_bluetooth|bool == true

- name: Configure disk mounts in /etc/fstab

Check failure on line 28 in tasks/prepare-pi.yml

View workflow job for this annotation

GitHub Actions / Lint

syntax-check[specific]

couldn't resolve module/action 'ansible.posix.mount'. This often indicates a misspelling, missing collection, or incorrect module path.
ansible.posix.mount:
Expand Down
49 changes: 0 additions & 49 deletions tasks/smoke-tests.yml

This file was deleted.

Loading

0 comments on commit 776e0c4

Please sign in to comment.