-
Notifications
You must be signed in to change notification settings - Fork 16
/
subscribe-instances.sh
executable file
·35 lines (24 loc) · 1.09 KB
/
subscribe-instances.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
. functions.sh
validate_config_rhn
function subscribe_host
{
fqdn=$1
# subscription manager
scmd $ssh_user@$fqdn sudo "bash -c \" subscription-manager unregister ; \
subscription-manager register --username=${rhnu} --password=${rhnp} --force ; \
subscription-manager attach --pool=${pool} ; \
subscription-manager repos --disable=*; \
subscription-manager repos --enable='rhel-7-server-rpms' \
--enable='rhel-7-server-extras-rpms' \
--enable='rhel-7-server-optional-rpms' \
--enable='rhel-7-server-ose-3.1-rpms'; \
yum update -y\"" < /dev/null
}
[[ ! "$target" == "" ]] && echo "overriding config and configuring for $target" && hosts=$target
for node in $hosts
do
fqdn="$node.$domain"
subscribe_host $fqdn &
done
wait