fix(collection): preserve standalone workflows and role boundaries

This commit is contained in:
Andy Lauppe 2026-03-11 00:06:01 -04:00
parent f8e08c9c5a
commit 9e1a918d6e
8 changed files with 117 additions and 115 deletions

View File

@ -50,7 +50,7 @@ git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Install in development mode
ansible-playbook playbooks/install.yml --ask-become-pass -e openclaw_install_mode=development
./run-playbook.sh -e openclaw_install_mode=development
```
## Installation as Ansible Collection
@ -211,9 +211,9 @@ For high-security environments, audit before running:
```bash
git clone https://github.com/openclaw/openclaw-ansible.git
cd openclaw-ansible
# Review playbooks/install.yml and roles/
ansible-playbook playbooks/install.yml --check --diff # Dry run
ansible-playbook playbooks/install.yml --ask-become-pass
# Review playbook.yml and roles/
ansible-playbook playbook.yml --check --diff # Dry run
ansible-playbook playbook.yml --ask-become-pass
```
## Documentation
@ -268,7 +268,7 @@ Build from source for development:
./run-playbook.sh -e openclaw_install_mode=development
# Or directly:
ansible-playbook playbooks/install.yml --ask-become-pass -e openclaw_install_mode=development
ansible-playbook playbook.yml --ask-become-pass -e openclaw_install_mode=development
```
This will:
@ -286,7 +286,7 @@ You can override them in three ways:
### 1. Via Command Line
```bash
ansible-playbook playbooks/install.yml --ask-become-pass \
ansible-playbook playbook.yml --ask-become-pass \
-e openclaw_install_mode=development \
-e "openclaw_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
```
@ -306,7 +306,7 @@ tailscale_authkey: "tskey-auth-xxxxxxxxxxxxx"
EOF
# Use it
ansible-playbook playbooks/install.yml --ask-become-pass -e @vars.yml
ansible-playbook playbook.yml --ask-become-pass -e @vars.yml
```
### 3. Edit Defaults Directly
@ -333,14 +333,14 @@ See [`roles/openclaw/defaults/main.yml`](roles/openclaw/defaults/main.yml) for t
#### SSH Keys for Remote Access
```bash
ansible-playbook playbooks/install.yml --ask-become-pass \
ansible-playbook playbook.yml --ask-become-pass \
-e "openclaw_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
```
#### Development Mode with Custom Repository
```bash
ansible-playbook playbooks/install.yml --ask-become-pass \
ansible-playbook playbook.yml --ask-become-pass \
-e openclaw_install_mode=development \
-e openclaw_repo_url=https://github.com/YOUR_USERNAME/openclaw.git \
-e openclaw_repo_branch=feature-branch
@ -349,7 +349,7 @@ ansible-playbook playbooks/install.yml --ask-become-pass \
#### Tailscale Auto-Connect
```bash
ansible-playbook playbooks/install.yml --ask-become-pass \
ansible-playbook playbook.yml --ask-become-pass \
-e tailscale_authkey=tskey-auth-xxxxxxxxxxxxx
```

3
ansible.cfg Normal file
View File

@ -0,0 +1,3 @@
[defaults]
# Keep repo-local playbooks runnable after the collection refactor.
roles_path = ./roles

View File

@ -18,7 +18,8 @@ all:
vars:
# SSH Public Keys for the 'openclaw' user (Optional)
# If set, these keys will be added to ~/.ssh/authorized_keys
# server_admin_public_key: "ssh-ed25519 AAAAC3Nz..."
# openclaw_ssh_keys:
# - "ssh-ed25519 AAAAC3Nz..."
# Tailscale Auth Key (Optional) - Leave empty to skip auto-connect
# tailscale_authkey: "tskey-auth-..."

View File

@ -19,4 +19,4 @@
when: is_linux
roles:
- openclaw.installer.openclaw
- openclaw

View File

@ -67,3 +67,103 @@
roles:
- openclaw
post_tasks:
- name: Copy ASCII art script
ansible.builtin.template:
src: "{{ playbook_dir }}/../roles/openclaw/templates/show-lobster.sh.j2"
dest: /tmp/show-lobster.sh
mode: '0755'
- name: Display ASCII art
ansible.builtin.command: /tmp/show-lobster.sh
changed_when: false
- name: Create one-time welcome message for openclaw user
ansible.builtin.copy:
dest: "{{ openclaw_home }}/.openclaw-welcome"
owner: "{{ openclaw_user }}"
group: "{{ openclaw_user }}"
mode: '0644'
content: |
echo ""
echo "╔════════════════════════════════════════════════════════╗"
echo "║ 📋 OpenClaw Setup - Next Steps ║"
echo "╚════════════════════════════════════════════════════════╝"
echo ""
echo "You are: $(whoami)@$(hostname)"
echo "Home: $HOME"
echo "OS: $(uname -s) $(uname -r)"
echo ""
echo "Environment is configured:"
echo " ✓ XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-not set}"
echo " ✓ DBUS_SESSION_BUS_ADDRESS: ${DBUS_SESSION_BUS_ADDRESS:-not set}"
echo " ✓ OpenClaw: $(openclaw --version 2>/dev/null || echo 'not found')"
echo ""
echo "────────────────────────────────────────────────────────"
echo "🚀 Quick Start - Run This Command:"
echo "────────────────────────────────────────────────────────"
echo ""
echo " openclaw onboard --install-daemon"
echo ""
echo "This will:"
echo " • Guide you through the setup wizard"
echo " • Configure your messaging provider"
echo " • Install and start the daemon service"
echo ""
echo "────────────────────────────────────────────────────────"
echo "📚 Alternative Manual Setup:"
echo "────────────────────────────────────────────────────────"
echo ""
echo "1⃣ Interactive onboarding (recommended):"
echo " openclaw onboard --install-daemon"
echo ""
echo "2⃣ Manual configuration:"
echo " openclaw configure"
echo " nano ~/.openclaw/openclaw.json"
echo ""
echo "3⃣ Login to messaging provider:"
echo " openclaw providers login"
echo ""
echo "4⃣ Test the gateway:"
echo " openclaw gateway"
echo ""
echo "5⃣ Install as daemon (if not using onboard):"
echo " openclaw daemon install"
echo " openclaw daemon start"
echo ""
echo "────────────────────────────────────────────────────────"
echo "🔧 Useful Commands:"
echo "────────────────────────────────────────────────────────"
echo ""
echo " • View logs: openclaw logs"
echo " • Check status: openclaw status"
echo " • Stop daemon: openclaw daemon stop"
echo " • Restart daemon: openclaw daemon restart"
echo " • Troubleshoot: openclaw doctor"
echo " • List agents: openclaw agents list"
echo ""
{% if tailscale_enabled | default(false) %}echo "────────────────────────────────────────────────────────"
echo "🌐 Connect Tailscale VPN (optional):"
echo "────────────────────────────────────────────────────────"
echo ""
echo " exit"
echo " sudo tailscale up"
echo ""
{% endif %}echo "────────────────────────────────────────────────────────"
echo ""
echo "Type 'exit' to return to your previous user"
echo ""
# Remove welcome message (suppress errors if already deleted)
rm -f "$HOME/.openclaw-welcome" 2>/dev/null || true
- name: Add welcome message to .bashrc
ansible.builtin.lineinfile:
path: "{{ openclaw_home }}/.bashrc"
line: '[ -f ~/.openclaw-welcome ] && source ~/.openclaw-welcome'
state: present
insertafter: EOF
- name: Notify that playbook is complete
ansible.builtin.debug:
msg: "✅ OpenClaw installation complete!"

View File

@ -1,99 +0,0 @@
---
- name: Copy ASCII art script
ansible.builtin.template:
src: show-lobster.sh.j2
dest: /tmp/show-lobster.sh
mode: '0755'
- name: Display ASCII art
ansible.builtin.command: /tmp/show-lobster.sh
changed_when: false
- name: Create one-time welcome message for openclaw user
ansible.builtin.copy:
dest: "{{ openclaw_home }}/.openclaw-welcome"
owner: "{{ openclaw_user }}"
group: "{{ openclaw_user }}"
mode: '0644'
content: |
echo ""
echo "╔════════════════════════════════════════════════════════╗"
echo "║ 📋 OpenClaw Setup - Next Steps ║"
echo "╚════════════════════════════════════════════════════════╝"
echo ""
echo "You are: $(whoami)@$(hostname)"
echo "Home: $HOME"
echo "OS: $(uname -s) $(uname -r)"
echo ""
echo "Environment is configured:"
echo " ✓ XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-not set}"
echo " ✓ DBUS_SESSION_BUS_ADDRESS: ${DBUS_SESSION_BUS_ADDRESS:-not set}"
echo " ✓ OpenClaw: $(openclaw --version 2>/dev/null || echo 'not found')"
echo ""
echo "────────────────────────────────────────────────────────"
echo "🚀 Quick Start - Run This Command:"
echo "────────────────────────────────────────────────────────"
echo ""
echo " openclaw onboard --install-daemon"
echo ""
echo "This will:"
echo " • Guide you through the setup wizard"
echo " • Configure your messaging provider"
echo " • Install and start the daemon service"
echo ""
echo "────────────────────────────────────────────────────────"
echo "📚 Alternative Manual Setup:"
echo "────────────────────────────────────────────────────────"
echo ""
echo "1⃣ Interactive onboarding (recommended):"
echo " openclaw onboard --install-daemon"
echo ""
echo "2⃣ Manual configuration:"
echo " openclaw configure"
echo " nano ~/.openclaw/openclaw.json"
echo ""
echo "3⃣ Login to messaging provider:"
echo " openclaw providers login"
echo ""
echo "4⃣ Test the gateway:"
echo " openclaw gateway"
echo ""
echo "5⃣ Install as daemon (if not using onboard):"
echo " openclaw daemon install"
echo " openclaw daemon start"
echo ""
echo "────────────────────────────────────────────────────────"
echo "🔧 Useful Commands:"
echo "────────────────────────────────────────────────────────"
echo ""
echo " • View logs: openclaw logs"
echo " • Check status: openclaw status"
echo " • Stop daemon: openclaw daemon stop"
echo " • Restart daemon: openclaw daemon restart"
echo " • Troubleshoot: openclaw doctor"
echo " • List agents: openclaw agents list"
echo ""
{% if tailscale_enabled | default(false) %}echo "────────────────────────────────────────────────────────"
echo "🌐 Connect Tailscale VPN (optional):"
echo "────────────────────────────────────────────────────────"
echo ""
echo " exit"
echo " sudo tailscale up"
echo ""
{% endif %}echo "────────────────────────────────────────────────────────"
echo ""
echo "Type 'exit' to return to your previous user"
echo ""
# Remove welcome message (suppress errors if already deleted)
rm -f "$HOME/.openclaw-welcome" 2>/dev/null || true
- name: Add welcome message to .bashrc
ansible.builtin.lineinfile:
path: "{{ openclaw_home }}/.bashrc"
line: '[ -f ~/.openclaw-welcome ] && source ~/.openclaw-welcome'
state: present
insertafter: EOF
- name: Notify that playbook is complete
ansible.builtin.debug:
msg: "✅ OpenClaw installation complete!"

View File

@ -22,6 +22,3 @@
- name: Include OpenClaw setup tasks
ansible.builtin.include_tasks: openclaw.yml
- name: Include completion tasks
ansible.builtin.include_tasks: completion.yml

View File

@ -37,7 +37,7 @@ extract_openclaw_user_from_args "$@"
# Determine playbook source
if [ -f "playbooks/install.yml" ]; then
echo "Running from local source..."
PLAYBOOK="playbooks/install.yml"
PLAYBOOK="playbook.yml"
export ANSIBLE_ROLES_PATH="${PWD}/roles:${ANSIBLE_ROLES_PATH}"
elif ansible-galaxy collection list 2>/dev/null | grep -q "openclaw.installer"; then
echo "Running from installed collection..."