Why point this to localhost? #5

Open
opened 2026-02-15 17:17:40 -05:00 by yindo · 4 comments
Owner

Originally created by @danielo515 on GitHub (Jan 29, 2026).

Hello.
I have been getting crazy trying to run this against a remote server for hours. I was feeling stupid, the I realized the playbook is hardcoded to point at localhost.
Why? Why don't you allow to install this in remote hosts? Let ansible do it's thing and don't force this to be a local install. I don't want to install ansible in the host I'm running clawdbot

Originally created by @danielo515 on GitHub (Jan 29, 2026). Hello. I have been getting crazy trying to run this against a remote server for hours. I was feeling stupid, the I realized the playbook is hardcoded to point at localhost. Why? Why don't you allow to install this in remote hosts? Let ansible do it's thing and don't force this to be a local install. I don't want to install ansible in the host I'm running clawdbot
Author
Owner

@pasogott commented on GitHub (Feb 4, 2026):

Send me a PR.

@pasogott commented on GitHub (Feb 4, 2026): Send me a PR.
Author
Owner

@funkytaco commented on GitHub (Feb 11, 2026):

This is user error. You can run playbooks to point at other hosts, even if host is set to localhost and set connection to ssh

@funkytaco commented on GitHub (Feb 11, 2026): This is user error. You can run playbooks to point at other hosts, even if host is set to localhost and set connection to ssh
Author
Owner

@danielo515 commented on GitHub (Feb 12, 2026):

This is user error. You can run playbooks to point at other hosts, even if host is set to localhost and set connection to ssh

Tell me how. I tried providing all class of inventories and list of hosts to point to. I want to use this with semaphore

@danielo515 commented on GitHub (Feb 12, 2026): > This is user error. You can run playbooks to point at other hosts, even if host is set to localhost and set connection to ssh Tell me how. I tried providing all class of inventories and list of hosts to point to. I want to use this with semaphore
Author
Owner

@MichaelMichaelMichaelMichaelMichael commented on GitHub (Feb 15, 2026):

This is user error. You can run playbooks to point at other hosts, even if host is set to localhost and set connection to ssh

Tell me how. I tried providing all class of inventories and list of hosts to point to. I want to use this with semaphore

You can run a playbook with hosts: localhost against other hosts by overriding the targets via command line:

Direct Inventory Override

ansible-playbook playbook.yml -i "192.168.1.10,"

The trailing comma is important - it tells Ansible you're providing a host list.

Extra Variables

Override the host variable:

ansible-playbook playbook.yml -e "ansible_host=192.168.1.10"

Or use a variable in your playbook:

- hosts: "{{ target_host | default('localhost') }}"
  connection: ssh

Then:

ansible-playbook playbook.yml -e "target_host=192.168.1.10"

Command-line parameters have the highest precedence and override all playbook settings.

important:

Because the playbook contains connection: local it won't connect to a remote host.
For that to work, you'd have to modify playbook.yml to:

- name: Install OpenClaw with Docker and UFW firewall
  hosts: all
  gather_facts: yes
  connection: ssh
  become: true
...

... and while you're at it, you might as well set hosts: all to facilitate the usage of a inventory.ini:

[openclawservers]
claw01


[all_servers:children]
openclawservers

[openclawservers:vars]
openclaw_user=openclaw
openclaw_home=/home/openclaw
openclaw_install_mode=release
openclaw_repo_url=https://github.com/openclaw/openclaw.git
openclaw_repo_branch=main

... which you then can invoke that way:

ansible-playbook playbook.yml -i inventory.ini --ask-become-pass 
@MichaelMichaelMichaelMichaelMichael commented on GitHub (Feb 15, 2026): > > This is user error. You can run playbooks to point at other hosts, even if host is set to localhost and set connection to ssh > > Tell me how. I tried providing all class of inventories and list of hosts to point to. I want to use this with semaphore You can run a playbook with `hosts: localhost` against other hosts by overriding the targets via command line: ## Direct Inventory Override ```bash ansible-playbook playbook.yml -i "192.168.1.10," ``` The trailing comma is important - it tells Ansible you're providing a host list. ## Extra Variables Override the host variable: ```bash ansible-playbook playbook.yml -e "ansible_host=192.168.1.10" ``` Or use a variable in your playbook: ```yaml - hosts: "{{ target_host | default('localhost') }}" connection: ssh ``` Then: ```bash ansible-playbook playbook.yml -e "target_host=192.168.1.10" ``` Command-line parameters have the highest precedence and override all playbook settings. ## important: Because the playbook contains `connection: local` it won't connect to a remote host. For that to work, you'd have to modify `playbook.yml` to: ```yaml - name: Install OpenClaw with Docker and UFW firewall hosts: all gather_facts: yes connection: ssh become: true ... ``` ... and while you're at it, you might as well set `hosts: all` to facilitate the usage of a `inventory.ini`: ```yaml [openclawservers] claw01 [all_servers:children] openclawservers [openclawservers:vars] openclaw_user=openclaw openclaw_home=/home/openclaw openclaw_install_mode=release openclaw_repo_url=https://github.com/openclaw/openclaw.git openclaw_repo_branch=main ``` ... which you then can invoke that way: ```bash ansible-playbook playbook.yml -i inventory.ini --ask-become-pass ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/openclaw-ansible#5