This repository has been archived on 2024-01-05. You can view files and clone it, but cannot push or open issues or pull requests.
gamma.fogtype.com/setup.yml

36 lines
1.4 KiB
YAML
Raw Normal View History

2022-12-26 00:25:28 +09:00
# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json#/$defs/playbook
- hosts: all
remote_user: ubuntu
vars_prompt:
- name: grafana_gcloud_api_key
prompt: GCLOUD_API_KEY
tasks:
- name: Grafana Cloud
ansible.builtin.shell: |
ARCH=amd64 GCLOUD_STACK_ID="373424" GCLOUD_API_URL="https://integrations-api-us-central.grafana.net" /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/agent/release/production/grafanacloud-install.sh)"
sed -i "s/ hostname\$/ $(hostname)/" /etc/grafana-agent.yaml
systemctl restart grafana-agent.service
become: true
environment:
GCLOUD_API_KEY: "{{ grafana_gcloud_api_key }}"
- ansible.builtin.apt_repository:
filename: docker
repo: deb [trusted=yes] https://download.docker.com/linux/ubuntu jammy stable
become: true
- ansible.builtin.apt_repository:
filename: tailscale
repo: deb [trusted=yes] https://pkgs.tailscale.com/stable/ubuntu jammy main
become: true
- ansible.builtin.apt:
pkg:
- docker-ce
- tailscale
install_recommends: false
become: true
- ansible.builtin.user:
name: "{{ ansible_user_id }}"
groups: docker
append: true
become: true
- ansible.builtin.meta: reset_connection