feat: initial commit
This commit is contained in:
parent
b01c462273
commit
3b80e81c3e
16 changed files with 262 additions and 93 deletions
14
tasks/cleanup.yaml
Normal file
14
tasks/cleanup.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
|
||||
# cleanup
|
||||
- name: "docker - prune all"
|
||||
community.docker.docker_prune:
|
||||
containers: true
|
||||
images: true
|
||||
networks: true
|
||||
volumes: true
|
||||
builder_cache: true
|
||||
|
||||
- name: "docker - force prune"
|
||||
ansible.builtin.command: "docker system prune --all --force --volumes"
|
||||
changed_when: false
|
||||
53
tasks/install.yaml
Normal file
53
tasks/install.yaml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
|
||||
# create directories
|
||||
- name: "create semaphore directories"
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: "directory"
|
||||
mode: "0755"
|
||||
loop:
|
||||
- "/mnt/semaphore"
|
||||
- "/mnt/semaphore/data"
|
||||
- "/mnt/semaphore/tmp"
|
||||
|
||||
# run semaphore
|
||||
- name: "run semaphore"
|
||||
community.docker.docker_container:
|
||||
container_default_behavior: "no_defaults"
|
||||
detach: "yes"
|
||||
pull: "always"
|
||||
state: "started"
|
||||
name: "semaphore"
|
||||
image: "docker.io/semaphoreui/semaphore:v2.16.18"
|
||||
restart_policy: "unless-stopped"
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- "/mnt/semaphore/data:/var/lib/semaphore"
|
||||
- "/mnt/semaphore/tmp:/tmp/semaphore"
|
||||
|
||||
env:
|
||||
|
||||
# ansible
|
||||
ANSIBLE_HOST_KEY_CHECKING: "False"
|
||||
|
||||
# semaphore
|
||||
SEMAPHORE_ADMIN_EMAIL: "{{ semaphore_admin_email }}"
|
||||
SEMAPHORE_ADMIN_NAME: "{{ semaphore_admin_name }}"
|
||||
SEMAPHORE_ADMIN_PASSWORD: "{{ semaphore_admin_password }}"
|
||||
SEMAPHORE_ADMIN: "{{ semaphore_admin_username }}"
|
||||
|
||||
SEMAPHORE_EMAIL_SENDER: "{{ semaphore_email_sender }}"
|
||||
SEMAPHORE_EMAIL_USERNAME: "{{ semaphore_email_username }}"
|
||||
SEMAPHORE_EMAIL_HOST: "{{ semaphore_email_host }}"
|
||||
SEMAPHORE_EMAIL_PORT: "{{ semaphore_email_port }}"
|
||||
SEMAPHORE_EMAIL_PASSWORD: "{{ semaphore_email_password }}"
|
||||
SEMAPHORE_EMAIL_SECURE: "True"
|
||||
SEMAPHORE_EMAIL_TLS: "True"
|
||||
|
||||
SEMAPHORE_DB_DIALECT: "sqlite"
|
||||
SEMAPHORE_RUNNER_REGISTRATION_TOKEN: "{{ semaphore_runner_token }}"
|
||||
SEMAPHORE_TOTP_ALLOW_RECOVERY: "True"
|
||||
SEMAPHORE_TOTP_ENABLED: "True"
|
||||
SEMAPHORE_USE_REMOTE_RUNNER: "True"
|
||||
13
tasks/main.yaml
Normal file
13
tasks/main.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
|
||||
# create network
|
||||
- name: "create network"
|
||||
ansible.builtin.import_tasks: "network.yaml"
|
||||
|
||||
# install semaphore
|
||||
- name: "install semaphore"
|
||||
ansible.builtin.import_tasks: "semaphore.yaml"
|
||||
|
||||
# cleanup docker
|
||||
- name: "cleanup docker"
|
||||
ansible.builtin.import_tasks: "cleanup.yaml"
|
||||
6
tasks/network.yaml
Normal file
6
tasks/network.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
|
||||
# create network
|
||||
- name: "docker create semaphore network"
|
||||
community.docker.docker_network:
|
||||
name: "semaphore"
|
||||
Loading…
Add table
Add a link
Reference in a new issue