koji_build: add new template file
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
parent
f545ece040
commit
a3cf18320e
1 changed files with 18 additions and 0 deletions
18
roles/koji_builder/templates/osbuildapi-update.sh
Normal file
18
roles/koji_builder/templates/osbuildapi-update.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
/usr/sbin/ipset create osbuildapi hash:ip >& /dev/null
|
||||
|
||||
{% if env == 'staging' %}
|
||||
RESOLVEQUERY=`resolvectl --cache=no --legend=no query api.stage.openshift.com 2> /dev/null`
|
||||
{% else %}
|
||||
RESOLVEQUERY=`resolvectl --cache=no --legend=no query api.openshift.com 2> /dev/null`
|
||||
{% endif %}
|
||||
test $? -eq 0 || exit $?
|
||||
|
||||
NEWIPS=`echo $RESOLVEQUERY | grep link | awk '{print $2 " " $6}' | sort -n`
|
||||
|
||||
/usr/sbin/ipset flush osbuildapi
|
||||
for j in $NEWIPS
|
||||
do
|
||||
/usr/sbin/ipset add osbuildapi $j
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue