Taking advantage of xargs's -P option to limit concurrency while executing all the ansible-playbook --check jobs ensures that batcave01 is not overstressed during these checks.
7 lines
260 B
Bash
Executable file
7 lines
260 B
Bash
Executable file
#! /bin/sh
|
|
|
|
rootpath="/srv/web/infra/ansible/playbooks"
|
|
parallel=8 # limit since ansible-playbook takes O(1GB) RAM each on batcave
|
|
|
|
find $rootpath/hosts $rootpath/groups -type f -name '*.yml' |
|
|
xargs -I'{}' -P $parallel ansible-playbook '{}' --check --diff
|