gitops/sync/config.yaml

29 lines
949 B
YAML

- name: Local Config Tasks
tasks:
- name: Install nginx (macOS/Homebrew or Linux/apt)
shell: |
if command -v brew &>/dev/null; then
brew install nginx || true
elif command -v apt-get &>/dev/null; then
sudo apt-get update && sudo apt-get install -y nginx
else
echo "⚠️ Unsupported OS"
fi
- name: Update /etc/hosts with test domain
shell: |
echo "127.0.0.1 test.cw-agent.local" | sudo tee -a /etc/hosts
- name: Create dummy SSL cert (for test)
shell: |
mkdir -p /tmp/ssl
openssl req -x509 -newkey rsa:2048 -keyout /tmp/ssl/key.pem -out /tmp/ssl/cert.pem -days 1 -nodes -subj "/CN=test.cw-agent.local"
- name: Reload nginx (if available)
shell: |
if command -v nginx &>/dev/null; then
sudo nginx -s reload || sudo brew services restart nginx
else
echo "nginx not found"
fi