beta.fogtype.com/setup.yml

43 lines
1.6 KiB
YAML
Raw Normal View History

2023-01-02 00:40:21 +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:
- ansible.posix.authorized_key:
user: ubuntu
key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJnt8d3tggYhyeIYK/mHhZXXzv22OdAoQY+eQoyTvfuD ubuntu@gamma
- 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.copy:
src: etc/docker/
dest: /etc/docker/
become: true
- 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