From a3844f2b087715c49f53a669330dba2c4a8823fb Mon Sep 17 00:00:00 2001 From: "Glenn K. Lockwood" Date: Mon, 27 Jul 2020 19:18:07 -0700 Subject: [PATCH] add stuff to make this run in remote mode too --- README.md | 11 +++++++++++ hosts.remote | 4 ++++ remote.yml | 7 +++++++ 3 files changed, 22 insertions(+) create mode 100644 hosts.remote create mode 100644 remote.yml diff --git a/README.md b/README.md index 9a80508..340aa57 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,17 @@ The format expected in `roles/common/vars/main.yml` is something like - etc/ssh/ssh_host_ecdsa_key.cloverdale - etc/ssh/ssh_host_ed25519_key.cloverdale +### Remote mode + +The playbooks can also be run in a traditional remote mode: + + $ ansible-playbook --ask-become-pass --ask-vault-pass --inventory hosts.remote ./remote.yml + +At present this does _not_ make use of hostvars; this is because the playbook +started out designed to be run against localhost and the playbook +self-identifies the system and fetches configuration variables from +`roles/common/vars/main.yml` based on that. + ## Acknowledgment I stole a lot of knowledge from https://github.com/giuaig/ansible-raspi-config/. diff --git a/hosts.remote b/hosts.remote new file mode 100644 index 0000000..97f5128 --- /dev/null +++ b/hosts.remote @@ -0,0 +1,4 @@ +[raspberrypi] +cloverdale.local +cloverleaf.local +clovermine.local diff --git a/remote.yml b/remote.yml new file mode 100644 index 0000000..c764f0a --- /dev/null +++ b/remote.yml @@ -0,0 +1,7 @@ +--- +- hosts: raspberrypi + become: yes + become_user: root + become_method: sudo + roles: + - common