playbooks: run shared playbooks only on --limit hosts
Without a limit the shared plays now match no hosts instead of the whole inventory.
Assisted-by: Claude Opus 5 via Claude Code
diff --git a/lotus-land-story/Rakefile b/lotus-land-story/Rakefile
index 470c3c7..8181901 100644
--- a/lotus-land-story/Rakefile
+++ b/lotus-land-story/Rakefile
@@ -31,7 +31,7 @@ desc ""
task :ansible, %i[ playbook ] => "vars.yml" do |_, args|
playbook = args.fetch(:playbook, "main")
- sh "ansible-playbook #{playbook}.yml"
+ sh "ansible-playbook --limit=lotus-land-story #{playbook}.yml"
end
task "terraform.tfvars" do |t|
diff --git a/playbooks/docker-purge.yml b/playbooks/docker-purge.yml
index 85986d5..830e1f4 100644
--- a/playbooks/docker-purge.yml
+++ b/playbooks/docker-purge.yml
@@ -2,7 +2,7 @@
# playbooks/docker.yml.
- name: Purge Docker
tags: docker-purge
- hosts: legacy-of-lunatic-kingdom
+ hosts: "{{ ansible_limit | default([]) }}"
become: true
tasks:
diff --git a/playbooks/docker.yml b/playbooks/docker.yml
index 867d8c4..60094d0 100644
--- a/playbooks/docker.yml
+++ b/playbooks/docker.yml
@@ -1,7 +1,7 @@
# https://docs.docker.com/engine/install/debian/
- name: Install Docker
tags: docker
- hosts: all
+ hosts: "{{ ansible_limit | default([]) }}"
become: true
tasks:
diff --git a/playbooks/podman.yml b/playbooks/podman.yml
index bef65c9..709371a 100644
--- a/playbooks/podman.yml
+++ b/playbooks/podman.yml
@@ -1,7 +1,7 @@
# https://podman.io/docs/installation#debian
- name: Install Podman
tags: podman
- hosts: all
+ hosts: "{{ ansible_limit | default([]) }}"
become: true
tasks:
diff --git a/playbooks/syncthing.yml b/playbooks/syncthing.yml
index 4772b0d..0e1fc26 100644
--- a/playbooks/syncthing.yml
+++ b/playbooks/syncthing.yml
@@ -2,7 +2,7 @@
- name: Install Syncthing
tags: syncthing
- hosts: all
+ hosts: "{{ ansible_limit | default([]) }}"
become: true
tasks:
diff --git a/playbooks/tailscale.yml b/playbooks/tailscale.yml
index a0b31e1..44e8b32 100644
--- a/playbooks/tailscale.yml
+++ b/playbooks/tailscale.yml
@@ -1,7 +1,7 @@
# https://tailscale.com/download/linux/debian-bookworm
- name: Install Tailscale
tags: tailscale
- hosts: all
+ hosts: "{{ ansible_limit | default([]) }}"
become: true
tasks:
@@ -64,7 +64,7 @@
update_cache: true
# - name: Restrict tailscaled logging
-# hosts: all
+# hosts: "{{ ansible_limit | default([]) }}"
# become: true
# tasks:
#
diff --git a/playbooks/unattended-upgrades.yml b/playbooks/unattended-upgrades.yml
index 24798fb..e783529 100644
--- a/playbooks/unattended-upgrades.yml
+++ b/playbooks/unattended-upgrades.yml
@@ -1,7 +1,7 @@
# https://wiki.debian.org/UnattendedUpgrades
- name: Configure unattended upgrades
tags: unattended-upgrades
- hosts: all
+ hosts: "{{ ansible_limit | default([]) }}"
become: true
tasks: