create γ project
This commit is contained in:
parent
2dc2dcd925
commit
9a0081e27e
4 changed files with 52 additions and 0 deletions
10
README.md
Normal file
10
README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# γ
|
||||
|
||||
## Setup
|
||||
|
||||
```sh
|
||||
sudo apt install ansible
|
||||
ansible-playbook setup.yml
|
||||
```
|
||||
|
||||
詳しい構成は [setup.yml](setup.yml) を参照
|
2
ansible.cfg
Normal file
2
ansible.cfg
Normal file
|
@ -0,0 +1,2 @@
|
|||
[defaults]
|
||||
inventory = etc/ansible/hosts
|
5
etc/ansible/hosts
Normal file
5
etc/ansible/hosts
Normal file
|
@ -0,0 +1,5 @@
|
|||
# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/inventory.json
|
||||
all:
|
||||
hosts:
|
||||
beta.fogtype.com:
|
||||
gamma.fogtype.com:
|
35
setup.yml
Normal file
35
setup.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
# 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
|
Reference in a new issue