Edge node
This commit is contained in:
parent
84b8964354
commit
c33b51a170
|
@ -0,0 +1,11 @@
|
|||
services:
|
||||
gitea-runner:
|
||||
container_name: gitea-runner
|
||||
image: gitea/act_runner:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- GITEA_INSTANCE_URL=https://git.bhasher.com
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_TOKEN}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
master:
|
||||
hosts:
|
||||
shp
|
||||
|
||||
edges:
|
||||
hosts:
|
||||
snode0
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- hosts: edges
|
||||
remote_user: pi
|
||||
become: true
|
||||
tasks:
|
||||
- name: Copy docker compose files
|
||||
ansible.builtin.copy:
|
||||
src: .
|
||||
dest: /home/pi/edge
|
||||
- name: Start edge services
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: /home/pi/edge
|
||||
build: never
|
||||
env_files: .env
|
||||
state: present
|
||||
register: output
|
||||
|
||||
- name: Show results
|
||||
ansible.builtin.debug:
|
||||
var: output
|
|
@ -0,0 +1,60 @@
|
|||
---
|
||||
- hosts: edges
|
||||
remote_user: pi
|
||||
become: true
|
||||
tasks:
|
||||
- name: Remove conflicting packages
|
||||
apt:
|
||||
name: "{{item}}"
|
||||
state: absent
|
||||
update_cache: yes
|
||||
loop:
|
||||
- docker.io
|
||||
- docker-doc
|
||||
- docker-compose
|
||||
- docker-compose-v2
|
||||
- podman-docker
|
||||
- containerd
|
||||
- runc
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
name: "{{item}}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
loop:
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
- name: add GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
- name: add docker repository to apt
|
||||
apt_repository:
|
||||
repo: deb https://download.docker.com/linux/ubuntu bionic stable
|
||||
state: present
|
||||
- name: install docker
|
||||
apt:
|
||||
name: "{{item}}"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
loop:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-buildx-plugin
|
||||
- docker-compose-plugin
|
||||
- name: check docker is active
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: yes
|
||||
- name: Ensure group "docker" exists
|
||||
ansible.builtin.group:
|
||||
name: docker
|
||||
state: present
|
||||
- name: adding ubuntu to docker group
|
||||
user:
|
||||
name: pi
|
||||
groups: docker
|
||||
append: yes
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
collections:
|
||||
- name: https://github.com/ansible-collections/community.docker
|
||||
type: git
|
||||
version: main
|
Loading…
Reference in New Issue