Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure all binds are present to avoid volume sprawl #11345

Merged
merged 5 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions salt/influxdb/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ influxlogdir:
- group: 939
- makedirs: True

influxetcdir:
file.directory:
- name: /opt/so/conf/influxdb/etc
- dir_mode: 750
- user: 939
- group: 939
- makedirs: True

influxdbdir:
file.directory:
- name: /nsm/influxdb
Expand Down
1 change: 1 addition & 0 deletions salt/influxdb/enabled.sls
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ so-influxdb:
- binds:
- /opt/so/log/influxdb/:/log:rw
- /opt/so/conf/influxdb/config.yaml:/conf/config.yaml:ro
- /opt/so/conf/influxdb/etc:/etc/influxdb2:rw
- /nsm/influxdb:/var/lib/influxdb2:rw
- /etc/pki/influxdb.crt:/conf/influxdb.crt:ro
- /etc/pki/influxdb.key:/conf/influxdb.key:ro
Expand Down
3 changes: 2 additions & 1 deletion salt/manager/tools/sbin/soup
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ post_to_2.4.10() {
}

post_to_2.4.20() {
echo "Nothing to apply"
echo "Pruning unused volumes"
docker volume prune -f
POSTVERSION=2.4.20
}

Expand Down
8 changes: 8 additions & 0 deletions salt/playbook/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ playbooklogdir:
- group: 939
- makedirs: True

playbookfilesdir:
file.directory:
- name: /opt/so/conf/playbook/redmine-files
- dir_mode: 775
- user: 939
- group: 939
- makedirs: True

{% if 'idh' in salt['cmd.shell']("ls /opt/so/saltstack/local/pillar/minions/|awk -F'_' {'print $2'}|awk -F'.' {'print $1'}").split() %}
idh-plays:
file.recurse:
Expand Down
1 change: 1 addition & 0 deletions salt/playbook/enabled.sls
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ so-playbook:
- sobridge:
- ipv4_address: {{ DOCKER.containers['so-playbook'].ip }}
- binds:
- /opt/so/conf/playbook/redmine-files:/usr/src/redmine/files:rw
- /opt/so/log/playbook:/playbook/log:rw
{% if DOCKER.containers['so-playbook'].custom_bind_mounts %}
{% for BIND in DOCKER.containers['so-playbook'].custom_bind_mounts %}
Expand Down
7 changes: 7 additions & 0 deletions salt/redis/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ redisworkdir:
- group: 939
- makedirs: True

redisdatadir:
file.directory:
- name: /nsm/redis/data
- user: 939
- group: 939
- makedirs: True

redislogdir:
file.directory:
- name: /opt/so/log/redis
Expand Down
1 change: 1 addition & 0 deletions salt/redis/enabled.sls
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ so-redis:
- /opt/so/log/redis:/var/log/redis:rw
- /opt/so/conf/redis/etc/redis.conf:/usr/local/etc/redis/redis.conf:ro
- /opt/so/conf/redis/working:/redis:rw
- /nsm/redis/data:/data:rw
- /etc/pki/redis.crt:/certs/redis.crt:ro
- /etc/pki/redis.key:/certs/redis.key:ro
{% if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-import'] %}
Expand Down
14 changes: 14 additions & 0 deletions salt/strelka/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ strelka_sbin:
- group: 939
- file_mode: 755

strelkagkredisdatadir:
file.directory:
- name: /nsm/strelka/gk-redis-data
- user: 939
- group: 939
- makedirs: True

strelkacoordredisdatadir:
file.directory:
- name: /nsm/strelka/coord-redis-data
- user: 939
- group: 939
- makedirs: True

{% else %}

{{sls}}_state_not_allowed:
Expand Down
5 changes: 3 additions & 2 deletions salt/strelka/coordinator/enabled.sls
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ strelka_coordinator:
- {{ XTRAENV }}
{% endfor %}
{% endif %}
{% if DOCKER.containers['so-strelka-coordinator'].custom_bind_mounts %}
- binds:
- /nsm/strelka/coord-redis-data:/data:rw
{% if DOCKER.containers['so-strelka-coordinator'].custom_bind_mounts %}
{% for BIND in DOCKER.containers['so-strelka-coordinator'].custom_bind_mounts %}
- {{ BIND }}
{% endfor %}
{% endif %}
{% endif %}
delete_so-strelka-coordinator_so-status.disabled:
file.uncomment:
- name: /opt/so/conf/so-status/so-status.conf
Expand Down
9 changes: 5 additions & 4 deletions salt/strelka/gatekeeper/enabled.sls
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ strelka_gatekeeper:
{% for BINDING in DOCKER.containers['so-strelka-gatekeeper'].port_bindings %}
- {{ BINDING }}
{% endfor %}
{% if DOCKER.containers['so-strelka-gatekeeper'].custom_bind_mounts %}
- binds:
{% for BIND in DOCKER.containers['so-strelka-gatekeeper'].custom_bind_mounts %}
- /nsm/strelka/gk-redis-data:/data:rw
{% if DOCKER.containers['so-strelka-gatekeeper'].custom_bind_mounts %}
{% for BIND in DOCKER.containers['so-strelka-gatekeeper'].custom_bind_mounts %}
- {{ BIND }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if DOCKER.containers['so-strelka-gatekeeper'].extra_env %}
- environment:
{% for XTRAENV in DOCKER.containers['so-strelka-gatekeeper'].extra_env %}
Expand Down
Loading