Skip to content

Commit

Permalink
Fixes #36886 - upload facts for new hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Nov 2, 2023
1 parent 52d4a50 commit d90c544
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/views/unattended/provisioning_templates/snippet/built.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ elif [ -x /usr/bin/wget ]; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' '<%= url %>'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

PATH=/usr/bin:/usr/sbin:/bin:/sbin:$PATH shutdown -r +1

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ elif [ -x /usr/bin/wget ]; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
PATH=/usr/bin:/usr/sbin:/bin:/sbin:$PATH shutdown -r +1
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,8 @@ elif [ -x /usr/bin/wget ]; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
PATH=/usr/bin:/usr/sbin:/bin:/sbin:$PATH shutdown -r +1
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

PATH=/usr/bin:/usr/sbin:/bin:/sbin:$PATH shutdown -r +1
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

rm /etc/resolv.conf
]]>
</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

rm /etc/resolv.conf
]]>
</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ if test -f /tmp/foreman_built; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
else
echo "calling home: build failed!"
if [ -x /usr/bin/curl ]; then
Expand All @@ -197,6 +201,10 @@ else
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/failed'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
fi

sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ if test -f /tmp/foreman_built; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
else
echo "calling home: build failed!"
if [ -x /usr/bin/curl ]; then
Expand All @@ -197,6 +201,10 @@ else
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/failed'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
fi

sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ if test -f /tmp/foreman_built; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
else
echo "calling home: build failed!"
if [ -x /usr/bin/curl ]; then
Expand All @@ -197,6 +201,10 @@ else
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/failed'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
fi

sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ if test -f /tmp/foreman_built; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
else
echo "calling home: build failed!"
if [ -x /usr/bin/curl ]; then
Expand All @@ -197,6 +201,10 @@ else
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/failed'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
fi

sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ if test -f /tmp/foreman_built; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
else
echo "calling home: build failed!"
if [ -x /usr/bin/curl ]; then
Expand All @@ -197,6 +201,10 @@ else
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/failed'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
fi

sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ if test -f /tmp/foreman_built; then
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
else
echo "calling home: build failed!"
if [ -x /usr/bin/curl ]; then
Expand All @@ -190,6 +194,10 @@ else
else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/failed'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi
fi

sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ else
wget -q -O /dev/null --header 'Content-Type: text/plain' 'http://foreman.example.com/unattended/built'
fi

if [ -x "$(command -v subscription-manager)" ] ; then
subscription-manager facts --update
fi

0 comments on commit d90c544

Please sign in to comment.