From 2a783098230ea338d28d0322a0100501f9cf87df Mon Sep 17 00:00:00 2001 From: Ozzy Date: Fri, 13 Sep 2024 11:36:05 +0100 Subject: [PATCH] Add some ansible stuff --- .github/workflows/ansible-lint.yml | 22 ++++++++++++++++++++ host_vars/bedroom-speaker.lan.yaml | 6 ++++++ host_vars/dining-room-pi.lan.yaml | 2 ++ host_vars/kitchen-speakers.lan.yaml | 10 +++++++++ host_vars/office-pi.lan.yaml | 5 +++++ host_vars/powermon.lan.yaml | 5 +++++ host_vars/terra.lan.yaml | 4 ++++ inventory | 32 +++++++++++++++++++++++++++++ playbooks/update-pis.yml | 9 ++++++++ 9 files changed, 95 insertions(+) create mode 100644 .github/workflows/ansible-lint.yml create mode 100644 host_vars/bedroom-speaker.lan.yaml create mode 100644 host_vars/dining-room-pi.lan.yaml create mode 100644 host_vars/kitchen-speakers.lan.yaml create mode 100644 host_vars/office-pi.lan.yaml create mode 100644 host_vars/powermon.lan.yaml create mode 100644 host_vars/terra.lan.yaml create mode 100644 inventory create mode 100644 playbooks/update-pis.yml diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml new file mode 100644 index 0000000..bd71029 --- /dev/null +++ b/.github/workflows/ansible-lint.yml @@ -0,0 +1,22 @@ +name: ansible-lint + +on: + push: + branches: [main] + paths: + - 'playbooks/**' + pull_request: + branches: [main] + paths: + - 'playbooks/**' + workflow_dispatch: + +permissions: + contents: read + +jobs: + ansible-lint: + name: ansible-lint + uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main + with: + args: '-p playbooks' \ No newline at end of file diff --git a/host_vars/bedroom-speaker.lan.yaml b/host_vars/bedroom-speaker.lan.yaml new file mode 100644 index 0000000..fd8ac26 --- /dev/null +++ b/host_vars/bedroom-speaker.lan.yaml @@ -0,0 +1,6 @@ +--- +node_id: bedroom +ble_sensors: + - name: bedroom + mac: a4:c1:38:2c:a9:a3 +snapclient_opts: -s sndrpihifiberry \ No newline at end of file diff --git a/host_vars/dining-room-pi.lan.yaml b/host_vars/dining-room-pi.lan.yaml new file mode 100644 index 0000000..b1c982f --- /dev/null +++ b/host_vars/dining-room-pi.lan.yaml @@ -0,0 +1,2 @@ +--- +snapclient_opts: -s sndrpihifiberry \ No newline at end of file diff --git a/host_vars/kitchen-speakers.lan.yaml b/host_vars/kitchen-speakers.lan.yaml new file mode 100644 index 0000000..343758b --- /dev/null +++ b/host_vars/kitchen-speakers.lan.yaml @@ -0,0 +1,10 @@ +--- +node_id: basement +ble_sensors: + - name: basement + mac: a4:c1:38:6e:e2:96 + - name: kitchen + mac: a4:c1:38:e1:12:b8 + - name: lounge + mac: a4:c1:38:fa:df:3e +snapclient_opts: -s sndrpihifiberry \ No newline at end of file diff --git a/host_vars/office-pi.lan.yaml b/host_vars/office-pi.lan.yaml new file mode 100644 index 0000000..74105d7 --- /dev/null +++ b/host_vars/office-pi.lan.yaml @@ -0,0 +1,5 @@ +--- +node_id: office +ble_sensors: + - name: office + mac: a4:c1:38:92:82:a3 \ No newline at end of file diff --git a/host_vars/powermon.lan.yaml b/host_vars/powermon.lan.yaml new file mode 100644 index 0000000..6a670a6 --- /dev/null +++ b/host_vars/powermon.lan.yaml @@ -0,0 +1,5 @@ +--- +node_id: utility +ble_sensors: + - name: utility + mac: a4:c1:38:88:c3:bf \ No newline at end of file diff --git a/host_vars/terra.lan.yaml b/host_vars/terra.lan.yaml new file mode 100644 index 0000000..b7d638f --- /dev/null +++ b/host_vars/terra.lan.yaml @@ -0,0 +1,4 @@ +--- +docker-services: + - 1000-km-year + - audiobookshelf \ No newline at end of file diff --git a/inventory b/inventory new file mode 100644 index 0000000..913ffaf --- /dev/null +++ b/inventory @@ -0,0 +1,32 @@ +[otherpis] +pihole.lan + +[powermon] +powermon.lan + +[speakers] +office-pi.lan +hifi-speakers.lan +bedroom-speakers.lan +basement-speakers.lan +kitchen-speakers.lan +hallway-speakers.lan +dining-room-pi.lan + +[bleScanners] +kitchen-speakers.lan +bedroom-speakers.lan +office-pi.lan + +[pis:children] +speakers +otherpis +powermon + +[pis:vars] +ansible_user=pi +ansible_ssh_pass=raspberry +ansible_python_interpreter=auto + +[docker1] +terra.lan \ No newline at end of file diff --git a/playbooks/update-pis.yml b/playbooks/update-pis.yml new file mode 100644 index 0000000..c553013 --- /dev/null +++ b/playbooks/update-pis.yml @@ -0,0 +1,9 @@ +- hosts: pis + become: yes + tasks: + - name: Update APT Cache + apt: + update_cache: yes + - name: Update packages + apt: + upgrade: safe \ No newline at end of file