Daemon/host/role accessories

Allow the hosts for accessories to be specified by host or role, or on
all app hosts by setting `daemon: true`.

```
  # Single host
  mysql:
    host: 1.1.1.1
  # Multiple hosts
  redis:
    hosts:
      - 1.1.1.1
      - 1.1.1.2
  # By role
  monitoring:
    roles:
      - web
      - jobs
```
This commit is contained in:
Donal McBreen
2023-03-28 13:05:09 +01:00
parent cec82ac641
commit c06585fef4
10 changed files with 165 additions and 56 deletions

View File

@@ -540,7 +540,8 @@ accessories:
memory: "2GB"
redis:
image: redis:latest
host: 1.1.1.4
role:
- web
port: "36379:6379"
volumes:
- /var/lib/redis:/data
@@ -550,6 +551,24 @@ accessories:
port: 44444
```
The hosts that the accessories will run on can be specified by host, role or on all app hosts:
```yaml
# Single host
mysql:
host: 1.1.1.1
# Multiple hosts
redis:
hosts:
- 1.1.1.1
- 1.1.1.2
# By role
monitoring:
roles:
- web
- jobs
```
Now run `mrsk accessory start mysql` to start the MySQL server on 1.1.1.3. See `mrsk accessory` for all the commands possible.
Accessory images must be public or tagged in your private registry.