forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add Squirrel Servers Manager (#167)
* 🚧 Add Squirrel Servers Manager Not working - pending hosted docker images * ✨ Add proper docker images
- Loading branch information
Showing
13 changed files
with
588 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -797,6 +797,10 @@ | |
tags: | ||
- speedtest-tracker | ||
|
||
- role: squirrel | ||
tags: | ||
- squirrel | ||
|
||
- role: stalwart | ||
tags: | ||
- stalwart | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
squirrel_enabled: false | ||
squirrel_available_externally: false | ||
|
||
# directories | ||
squirrel_data_directory: "{{ docker_home }}/squirrel" | ||
|
||
# network | ||
squirrel_port: "8154" | ||
squirrel_hostname: "squirrel" | ||
squirrel_network_name: "squirrel" | ||
|
||
# specs | ||
squirrel_server_memory: 1g | ||
squirrel_client_memory: 1g | ||
squirrel_proxy_memory: 1g | ||
squirrel_mongo_memory: 1g | ||
squirrel_redis_memory: 1g | ||
|
||
# docker | ||
squirrel_proxy_container_name: squirrel-proxy | ||
squirrel_proxy_image_name: "nginx" | ||
squirrel_proxy_image_version: alpine | ||
squirrel_mongo_container_name: squirrel-mongodb | ||
squirrel_mongo_image_name: mongo | ||
squirrel_mongo_image_version: 4.4.29 | ||
squirrel_redis_container_name: squirrel-redis | ||
squirrel_redis_image_name: redis | ||
squirrel_redis_image_version: latest | ||
squirrel_server_container_name: squirrel-server | ||
squirrel_server_image_name: "ghcr.io/squirrelcorporation/squirrelserversmanager-server" | ||
squirrel_server_image_version: latest | ||
squirrel_client_container_name: squirrel-client | ||
squirrel_client_image_name: "ghcr.io/squirrelcorporation/squirrelserversmanager-client" | ||
squirrel_client_image_version: latest | ||
squirrel_user_id: "1000" | ||
squirrel_group_id: "1000" | ||
|
||
# squirrel | ||
squirrel_server_node_env: production | ||
squirrel_secret: REPLACE_ME | ||
squirrel_salt: "1234567890123456" | ||
squirrel_vault_pwd: REPLACE_ME | ||
squirrel_db_host: "{{ squirrel_mongo_container_name }}" | ||
squirrel_db_name: ssm | ||
squirrel_db_port: "27017" | ||
squirrel_redis_host: "{{ squirrel_redis_container_name }}" | ||
squirrel_redis_port: "6379" | ||
|
||
squirrel_env: | ||
NODE_ENV: "{{ squirrel_server_node_env }}" | ||
SECRET: "{{ squirrel_secret }}" | ||
SALT: "{{ squirrel_salt }}" | ||
VAULT_PWD: "{{ squirrel_vault_pwd }}" | ||
DB_HOST: "{{ squirrel_db_host }}" | ||
DB_NAME: "{{ squirrel_db_name }}" | ||
DB_PORT: "{{ squirrel_db_port }}" | ||
REDIS_HOST: "{{ squirrel_redis_host }}" | ||
REDIS_PORT: "{{ squirrel_redis_port }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Squirrel Servers Manager | ||
|
||
Homepage: [https://github.com/SquirrelCorporation/SquirrelServersManager](https://github.com/SquirrelCorporation/SquirrelServersManager) | ||
|
||
A user friendly, UI/UX focus server & configuration management tool. | ||
|
||
## Usage | ||
|
||
Set `squirrel_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
Squirrel Servers Manager web interface can be found at [http://ansible_nas_host_or_ip:8154](http://ansible_nas_host_or_ip:8154). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
<html> | ||
|
||
<head> | ||
<style> | ||
html, | ||
body { | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
background-repeat: no-repeat; | ||
background-size: 100% auto; | ||
background-color: black; | ||
} | ||
|
||
.loading-title { | ||
font-size: 1.1rem; | ||
color: #888; | ||
} | ||
|
||
.loading-sub-title { | ||
margin-top: 20px; | ||
font-size: 1rem; | ||
color: #888; | ||
} | ||
|
||
.page-loading-warp { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 26px; | ||
} | ||
|
||
.ant-spin { | ||
position: absolute; | ||
display: none; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
margin: 0; | ||
padding: 0; | ||
color: rgba(0, 0, 0, 0.65); | ||
color: #1890ff; | ||
font-size: 14px; | ||
font-variant: tabular-nums; | ||
line-height: 1.5; | ||
text-align: center; | ||
list-style: none; | ||
opacity: 0; | ||
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); | ||
transition: -webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); | ||
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); | ||
transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86), | ||
-webkit-transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86); | ||
-webkit-font-feature-settings: "tnum"; | ||
font-feature-settings: "tnum"; | ||
} | ||
|
||
.ant-spin-spinning { | ||
position: static; | ||
display: inline-block; | ||
opacity: 1; | ||
} | ||
|
||
.ant-spin-dot { | ||
position: relative; | ||
display: inline-block; | ||
width: 20px; | ||
height: 20px; | ||
font-size: 20px; | ||
} | ||
|
||
.ant-spin-dot-item { | ||
position: absolute; | ||
display: block; | ||
width: 9px; | ||
height: 9px; | ||
background-color: #1890ff; | ||
border-radius: 100%; | ||
-webkit-transform: scale(0.75); | ||
-ms-transform: scale(0.75); | ||
transform: scale(0.75); | ||
-webkit-transform-origin: 50% 50%; | ||
-ms-transform-origin: 50% 50%; | ||
transform-origin: 50% 50%; | ||
opacity: 0.3; | ||
-webkit-animation: antspinmove 1s infinite linear alternate; | ||
animation: antSpinMove 1s infinite linear alternate; | ||
} | ||
|
||
.ant-spin-dot-item:nth-child(1) { | ||
top: 0; | ||
left: 0; | ||
} | ||
|
||
.ant-spin-dot-item:nth-child(2) { | ||
top: 0; | ||
right: 0; | ||
-webkit-animation-delay: 0.4s; | ||
animation-delay: 0.4s; | ||
} | ||
|
||
.ant-spin-dot-item:nth-child(3) { | ||
right: 0; | ||
bottom: 0; | ||
-webkit-animation-delay: 0.8s; | ||
animation-delay: 0.8s; | ||
} | ||
|
||
.ant-spin-dot-item:nth-child(4) { | ||
bottom: 0; | ||
left: 0; | ||
-webkit-animation-delay: 1.2s; | ||
animation-delay: 1.2s; | ||
} | ||
|
||
.ant-spin-dot-spin { | ||
-webkit-transform: rotate(45deg); | ||
-ms-transform: rotate(45deg); | ||
transform: rotate(45deg); | ||
-webkit-animation: antrotate 1.2s infinite linear; | ||
animation: antRotate 1.2s infinite linear; | ||
} | ||
|
||
.ant-spin-lg .ant-spin-dot { | ||
width: 32px; | ||
height: 32px; | ||
font-size: 32px; | ||
} | ||
|
||
.ant-spin-lg .ant-spin-dot i { | ||
width: 14px; | ||
height: 14px; | ||
} | ||
|
||
@media all and (-ms-high-contrast: none), | ||
(-ms-high-contrast: active) { | ||
.ant-spin-blur { | ||
background: #fff; | ||
opacity: 0.5; | ||
} | ||
} | ||
|
||
@-webkit-keyframes antSpinMove { | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
@keyframes antSpinMove { | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
@-webkit-keyframes antRotate { | ||
to { | ||
-webkit-transform: rotate(405deg); | ||
transform: rotate(405deg); | ||
} | ||
} | ||
|
||
@keyframes antRotate { | ||
to { | ||
-webkit-transform: rotate(405deg); | ||
transform: rotate(405deg); | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div style=" | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
min-height: 362px; | ||
"> | ||
<div class="page-loading-warp"> | ||
<div class="ant-spin ant-spin-lg ant-spin-spinning"> | ||
<span class="ant-spin-dot ant-spin-dot-spin"> | ||
<i class="ant-spin-dot-item"></i> | ||
<i class="ant-spin-dot-item"></i> | ||
<i class="ant-spin-dot-item"></i> | ||
<i class="ant-spin-dot-item"></i> | ||
</span> | ||
</div> | ||
</div> | ||
<div class="loading-title"> | ||
Squirrel Servers Manager | ||
</div> | ||
<div class="loading-sub-title"> | ||
Starting | ||
</div> | ||
</div> | ||
</body> | ||
<script> | ||
setTimeout(function () { | ||
window.location.reload(); | ||
}, 5000); | ||
</script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
platforms: | ||
- name: instance | ||
image: geerlingguy/docker-ubuntu2204-ansible:latest | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /tmp:/tmp | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
squirrel_enabled: true | ||
squirrel_data_directory: /tmp/squirrel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Stop | ||
hosts: all | ||
become: true | ||
tasks: | ||
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role" | ||
ansible.builtin.include_role: | ||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" | ||
vars: | ||
squirrel_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Include vars | ||
ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Get squirrel mongo container state | ||
community.docker.docker_container: | ||
name: "{{ squirrel_mongo_container_name }}" | ||
register: result_mongo | ||
|
||
- name: Get squirrel redis container state | ||
community.docker.docker_container: | ||
name: "{{ squirrel_redis_container_name }}" | ||
register: result_redis | ||
|
||
- name: Get squirrel server container state | ||
community.docker.docker_container: | ||
name: "{{ squirrel_server_container_name }}" | ||
register: result_server | ||
|
||
- name: Get squirrel client container state | ||
community.docker.docker_container: | ||
name: "{{ squirrel_client_container_name }}" | ||
register: result_client | ||
|
||
- name: Get squirrel proxy container state | ||
community.docker.docker_container: | ||
name: "{{ squirrel_proxy_container_name }}" | ||
register: result_proxy | ||
|
||
- name: Check if squirrel containers are running | ||
ansible.builtin.assert: | ||
that: | ||
- result_mongo.container['State']['Status'] == "running" | ||
- result_mongo.container['State']['Restarting'] == false | ||
- result_redis.container['State']['Status'] == "running" | ||
- result_redis.container['State']['Restarting'] == false | ||
- result_server.container['State']['Status'] == "running" | ||
- result_server.container['State']['Restarting'] == false | ||
- result_client.container['State']['Status'] == "running" | ||
- result_client.container['State']['Restarting'] == false | ||
- result_proxy.container['State']['Status'] == "running" | ||
- result_proxy.container['State']['Restarting'] == false |
Oops, something went wrong.