2022-12-10 18:16:50 +01:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
vars:
|
|
|
|
ENABLED_FILE: enabled
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
enable-all:
|
|
|
|
desc: Enable all available services
|
|
|
|
cmds:
|
|
|
|
- rm {{.ENABLED_FILE}}
|
|
|
|
- touch {{.ENABLED_FILE}}
|
|
|
|
- |
|
|
|
|
for s in $(find ./services/ -type d -mindepth 1 -maxdepth 1 -print) ; do
|
|
|
|
echo $(basename $s) >> {{.ENABLED_FILE}}
|
|
|
|
done
|
|
|
|
- echo "Enabled services:"
|
|
|
|
- cat {{.ENABLED_FILE}}
|
|
|
|
|
|
|
|
disable-all:
|
|
|
|
desc: Disable all available services
|
|
|
|
cmds:
|
|
|
|
- rm {{.ENABLED_FILE}}
|
|
|
|
- touch {{.ENABLED_FILE}}
|
|
|
|
- echo "Enabled services:"
|
|
|
|
- cat {{.ENABLED_FILE}}
|
|
|
|
|
|
|
|
enable:
|
|
|
|
desc: Enable given services
|
|
|
|
cmds:
|
|
|
|
- |
|
|
|
|
for s in {{.CLI_ARGS}} ; do
|
|
|
|
echo " enabling $s"
|
|
|
|
echo "$s" >> {{.ENABLED_FILE}}
|
|
|
|
done
|
|
|
|
- sort -o {{.ENABLED_FILE}} {{.ENABLED_FILE}}
|
|
|
|
- echo "Enabled services:"
|
|
|
|
- cat {{.ENABLED_FILE}}
|
|
|
|
|
|
|
|
disable:
|
|
|
|
desc: Disable given services
|
|
|
|
cmds:
|
|
|
|
- |
|
|
|
|
for s in {{.CLI_ARGS}} ; do
|
|
|
|
echo " disabling $s"
|
2022-12-22 18:11:48 +01:00
|
|
|
sed -i "/$s/d" {{.ENABLED_FILE}}
|
2022-12-10 18:16:50 +01:00
|
|
|
done
|
|
|
|
- echo "Enabled services:"
|
|
|
|
- cat {{.ENABLED_FILE}}
|
|
|
|
|
|
|
|
list:
|
|
|
|
desc: List all {{.ENABLED_FILE}} services
|
|
|
|
cmds:
|
|
|
|
- echo "Enabled services:"
|
|
|
|
- cat {{.ENABLED_FILE}}
|