2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-29 00:31:09 +00:00

Compare commits

..

32 Commits

Author SHA1 Message Date
Jarrod Johnson a54a9a5d09 Enable ipmi user if required
If redfish models ipmi as an account type, and user wants ipmi, add it to the account.
2022-06-27 14:34:37 -04:00
Jarrod Johnson 9b79da9522 Add a catch all to redfish for xcc
Newer xcc changes things yet again, but
we are comfortably in the firmware that can be bootstrapped
with redfish, so use that instead once we've cleared the
redfish incapable variants.
2022-06-27 14:12:51 -04:00
Jarrod Johnson 04c2b1a322 Provide an authenticated path for discovery registration 2022-06-22 16:47:40 -04:00
Jarrod Johnson 559a7ca7b8 Merge branch 'master' into remote_discovery 2022-06-21 14:56:56 -04:00
Jarrod Johnson 0a10311fea Add more verbose ssh connection feedback
Make the nature of connecting more explicit and errors
more reliably holding the session up and asking for relog
2022-06-17 15:35:06 -04:00
Jarrod Johnson 715bcb2f50 Prevent shell session from playing console output 2022-06-17 14:54:41 -04:00
Jarrod Johnson 8d5ad0d4a6 Fix EL7 spec file syntax 2022-06-17 13:11:08 -04:00
Jarrod Johnson 1387a67b61 Correct spec syntax error 2022-06-17 12:37:20 -04:00
Jarrod Johnson 4b08273379 Move EL7 back to python2
EL7's python3 support is barren and would require a lot of dependency
work.

Move EL7 back to python2 and will deprecate EL7 support when we ditch
python2
2022-06-17 12:10:44 -04:00
Jarrod Johnson e0c3232180 Fix syntax error in el7 prescript 2022-06-17 09:30:26 -04:00
Jarrod Johnson bd95f00680 Fix EL7 typeo in postscript 2022-06-17 09:08:12 -04:00
Jarrod Johnson bfecaa389d Adjust to correct ntp for 9 and up 2022-06-17 09:06:33 -04:00
Jarrod Johnson 7aca7a19f9 Install apiclient in a normal location for EL7 2022-06-15 16:42:50 -04:00
Jarrod Johnson c400671ad7 Add old profile compatible apiclient location 2022-06-15 16:39:55 -04:00
Jarrod Johnson c96955b369 Add catch-all packaging for EL7
EL7 now precompiles and flags it in the packaging
2022-06-15 16:34:57 -04:00
Jarrod Johnson 2bb519c158 Fix EL7 deployment compatibility 2022-06-15 16:10:57 -04:00
Jarrod Johnson e5c33cacd5 Change SuSE rpm name to pyyaml 2022-06-15 15:11:07 -04:00
Jarrod Johnson 03f0f16ed8 Change to dnspython for suse 2022-06-15 15:06:52 -04:00
Jarrod Johnson 0f815dc7d3 Switch to python3 for all builds 2022-06-15 15:00:19 -04:00
Jarrod Johnson dbdc99905d Update confluent server to python3 dependencies only 2022-06-15 14:31:32 -04:00
Jarrod Johnson 2d665fb816 Merge branch 'py2to3' 2022-06-15 12:42:04 -04:00
Jarrod Johnson 26e0fa8c91 Add swraid example to misc 2022-06-15 09:50:06 -04:00
Jarrod Johnson 83da1359df Add a sample vroc 'pre' script for reference 2022-06-15 08:40:23 -04:00
Jarrod Johnson 0f1581f8f7 Add a sample script to fetch user/pass info from confluent db 2022-06-10 14:18:35 -04:00
Jarrod Johnson 64b8893b80 Add a delta pdu plugin
This has received limited testing, and the PDUs cannot be used with secure protocols
2022-06-03 10:24:25 -04:00
Jarrod Johnson f13df801fd Merge branch 'master' into remote_discovery 2022-05-31 13:53:47 -04:00
Jarrod Johnson ee1a763c68 Add el7 to alternat squashfs name 2022-05-09 09:57:35 -04:00
Jarrod Johnson f138b4513c Merge branch 'master' into remote_discovery 2022-05-09 08:33:24 -04:00
Jarrod Johnson d8a2671dd6 Fix directory traversal 2022-04-25 13:11:43 -04:00
Jarrod Johnson 14efec3603 Add file to show the rpm versions at build time of genesis 2022-04-25 13:04:45 -04:00
Jarrod Johnson 00589d06f5 Refactor relay and add to XCC/SMM
Extract relay versus direct determination and
inject into XCC and SMM handlers
2022-04-21 09:40:09 -04:00
Jarrod Johnson 334ce65919 Add facility for forwarding agent
Remote discovery will require that the reporting agent
provides port forwarding facility for https access, to
allow access without route to the managing confluent server.

This will allow the info reported to indicate use of this
forwarding facility and the base handler adds ability to
generically get the certificate.
2022-04-20 17:11:01 -04:00
16 changed files with 192 additions and 45 deletions
+7 -14
View File
@@ -24,25 +24,17 @@ a confluent server.
%setup -n %{name}-%{version} -n %{name}-%{version}
%build
%if "%{dist}" == ".el8"
python3 setup.py build
%else
%if "%{dist}" == ".el9"
python3 setup.py build
%else
%if "%{dist}" == ".el7"
python2 setup.py build
%endif
%else
python3 setup.py build
%endif
%install
%if "%{dist}" == ".el8"
python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --install-scripts=/opt/confluent/bin --install-purelib=/opt/confluent/lib/python
%else
%if "%{dist}" == ".el9"
python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --install-scripts=/opt/confluent/bin --install-purelib=/opt/confluent/lib/python
%else
%if "%{dist}" == ".el7"
python2 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --install-scripts=/opt/confluent/bin --install-purelib=/opt/confluent/lib/python
%endif
%else
python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --install-scripts=/opt/confluent/bin --install-purelib=/opt/confluent/lib/python
%endif
@@ -52,3 +44,4 @@ rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%license /opt/confluent/share/licenses/confluent_client/LICENSE
%defattr(-,root,root)
/opt/confluent
@@ -20,3 +20,4 @@ for i in /ssh/*.ca; do
done
mkdir -p /sysroot/opt/confluent/bin
cp /opt/confluent/bin/apiclient /sysroot/opt/confluent/bin
cp /opt/confluent/bin/apiclient /sysroot/etc/confluent/
@@ -79,5 +79,9 @@ if [ -e /tmp/installdisk -a ! -e /tmp/partitioning ]; then
echo ignoredisk --only-use $(cat /tmp/installdisk) >> /tmp/partitioning
echo autopart --nohome $LUKSPARTY >> /tmp/partitioning
fi
python /etc/confluent/apiclient /confluent-public/os/$confluent_profile/kickstart.custom -o /tmp/kickstart.custom
if [ -f /opt/confluent/bin/apiclient ]; then
python /opt/confluent/bin/apiclient /confluent-public/os/$confluent_profile/kickstart.custom -o /tmp/kickstart.custom
else
python /etc/confluent/apiclient /confluent-public/os/$confluent_profile/kickstart.custom -o /tmp/kickstart.custom
fi
kill $logshowpid
@@ -10,6 +10,8 @@
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
export confluent_mgr confluent_profile nodename
cp -a /etc/confluent /mnt/sysimage/etc
mkdir -p /mnt/sysimage/opt/confluent/bin
cp /opt/confluent/bin/apiclient /mnt/sysimage/opt/confluent/bin/
chmod -R og-rwx /mnt/sysimage/etc/confluent
cp /tmp/functions /mnt/sysimage/etc/confluent/
hostnamectl set-hostname $nodename
@@ -42,11 +42,20 @@ echo lang $locale > /tmp/langinfo
echo keyboard --vckeymap=$keymap >> /tmp/langinfo
tz=$(grep ^timezone: /etc/confluent/confluent.deploycfg)
tz=${tz#timezone: }
MVER=$(grep VERSION_ID /etc/os-release|cut -d = -f 2 |cut -d . -f 1|cut -d '"' -f 2)
ntpsrvs=""
if grep ^ntpservers: /etc/confluent/confluent.deploycfg > /dev/null; then
ntpsrvs="--ntpservers="$(sed -n '/^ntpservers:/,/^[^-]/p' /etc/confluent/confluent.deploycfg|sed 1d|sed '$d' | sed -e 's/^- //' | paste -sd,)
if [ "$MVER" -ge 9 ]; then
if grep ^ntpservers: /etc/confluent/confluent.deploycfg > /dev/null; then
for ntpsrv in $(sed -n '/^ntpservers:/,/^[^-]/p' /etc/confluent/confluent.deploycfg|sed 1d|sed '$d' | sed -e 's/^- //'); do
echo timesource --ntp-server $ntpsrv >> /tmp/timezone
done
fi
else
if grep ^ntpservers: /etc/confluent/confluent.deploycfg > /dev/null; then
ntpsrvs="--ntpservers="$(sed -n '/^ntpservers:/,/^[^-]/p' /etc/confluent/confluent.deploycfg|sed 1d|sed '$d' | sed -e 's/^- //' | paste -sd,)
fi
fi
echo timezone $ntpsrvs $tz --utc > /tmp/timezone
echo timezone $ntpsrvs $tz --utc >> /tmp/timezone
rootpw=$(grep ^rootpassword /etc/confluent/confluent.deploycfg | awk '{print $2}')
if [ "$rootpw" = null ]; then
echo "rootpw --lock" > /tmp/rootpw
@@ -429,6 +429,8 @@ def handle_api_request(configmanager, inputdata, operation, pathcomponents):
return (msg.KeyValueData({'rescan': 'started'}),)
elif operation in ('update', 'create'):
if pathcomponents == ['discovery', 'register']:
return
if 'node' not in inputdata:
raise exc.InvalidArgumentException('Missing node name in input')
mac = _get_mac_from_query(pathcomponents)
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import confluent.util as util
import errno
import eventlet
import socket
@@ -31,6 +32,17 @@ class NodeHandler(object):
self.info = info
self.configmanager = configmanager
targsa = [None]
self.ipaddr = None
self.relay_url = None
self.relay_server = None
self.web_ip = None
self.web_port = None
# if this is a remote registered component, prefer to use the agent forwarder
if info.get('forwarder_url', False):
self.relay_url = info['forwarder_url']
self.relay_server = info['forwarder_server']
self.relay_token = info['forwarder_token']
return
# first let us prefer LLA if possible, since that's most stable
for sa in info['addresses']:
if sa[0].startswith('fe80'):
@@ -103,11 +115,8 @@ class NodeHandler(object):
def https_cert(self):
if self._fp:
return self._fp
if ':' in self.ipaddr:
ip = '[{0}]'.format(self.ipaddr)
else:
ip = self.ipaddr
wc = webclient.SecureHTTPConnection(ip, verifycallback=self._savecert)
ip, port = self.get_web_port_and_ip()
wc = webclient.SecureHTTPConnection(ip, verifycallback=self._savecert, port=port)
try:
wc.connect()
except IOError as ie:
@@ -123,3 +132,32 @@ class NodeHandler(object):
self._certfailreason = 2
return None
return self._fp
def get_web_port_and_ip(self):
if self.web_ip:
return self.web_ip, self.web_port
# get target ip and port, either direct or relay as applicable
if self.relay_url:
kv = util.TLSCertVerifier(self.configmanager, self.relay_server,
'pubkeys.tls_hardwaremanager').verify_cert
w = webclient.SecureHTTPConnection(self.relay_server, verifycallback=kv)
relaycreds = self.configmanager.get_node_attributes(self.relay_server, 'secret.*', decrypt=True)
relaycreds = relaycreds.get(self.relay_server, {})
relayuser = relaycreds.get('secret.hardwaremanagementuser', {}).get('value', None)
relaypass = relaycreds.get('secret.hardwaremanegementpassword', {}).get('value', None)
if not relayuser or not relaypass:
raise Exception('No credentials for {0}'.format(self.relay_server))
w.set_basic_credentials(relayuser, relaypass)
w.connect()
w.request('GET', self.relay_url)
r = w.getresponse()
rb = r.read()
if r.code != 302:
raise Exception('Unexpected return from forwarder')
newurl = r.getheader('Location')
self.web_port = int(newurl.rsplit(':', 1)[-1][:-1])
self.web_ip = self.relay_server
else:
self.web_port = 443
self.web_ip = self.ipaddr
return self.web_ip, self.web_port
@@ -135,7 +135,8 @@ class NodeHandler(bmchandler.NodeHandler):
{nodename: {'hardwaremanagement.manager': self.ipaddr}})
def _webconfigcreds(self, username, password):
wc = webclient.SecureHTTPConnection(self.ipaddr, 443, verifycallback=self._validate_cert)
ip, port = self.get_web_port_and_ip()
wc = webclient.SecureHTTPConnection(ip, port, verifycallback=self._validate_cert)
wc.connect()
authdata = { # start by trying factory defaults
'user': 'USERID',
@@ -67,7 +67,8 @@ class NodeHandler(immhandler.NodeHandler):
return None
def scan(self):
c = webclient.SecureHTTPConnection(self.ipaddr, 443,
ip, port = self.get_web_port_and_ip()
c = webclient.SecureHTTPConnection(ip, port,
verifycallback=self.validate_cert)
i = c.grab_json_response('/api/providers/logoninfo')
modelname = i.get('items', [{}])[0].get('machine_name', None)
@@ -279,8 +280,9 @@ class NodeHandler(immhandler.NodeHandler):
isdefault = True
errinfo = {}
if self._wc is None:
ip, port = self.get_web_port_and_ip()
self._wc = webclient.SecureHTTPConnection(
self.ipaddr, 443, verifycallback=self.validate_cert)
ip, port, verifycallback=self.validate_cert)
self._wc.connect()
nodename = None
if self.nodename:
@@ -409,7 +411,21 @@ class NodeHandler(immhandler.NodeHandler):
rsp, status = wc.grab_json_response_with_status(
'/api/function',
{'USER_UserModify': '{0},{1},,1,4,0,0,0,0,,8,,,'.format(uid, username)})
if status == 200 and rsp.get('return', 0) == 13:
wc.set_basic_credentials(self._currcreds[0], self._currcreds[1])
status = 503
while status != 200:
rsp, status = wc.grab_json_response_with_status(
'/redfish/v1/AccountService/Accounts/{0}'.format(uid),
{'UserName': username}, method='PATCH')
if status != 200:
rsp = json.loads(rsp)
if rsp.get('error', {}).get('code', 'Unknown') in ('Base.1.8.GeneralError', 'Base.1.12.GeneralError'):
eventlet.sleep(10)
else:
break
self.tmppasswd = None
wc.grab_json_response('/api/providers/logout')
self._currcreds = (username, passwd)
def _convert_sha256account(self, user, passwd, wc):
@@ -501,6 +517,7 @@ class NodeHandler(immhandler.NodeHandler):
'Request to use default credentials, but refused by target after it has been changed to {0}'.format(self.tmppasswd))
if not isdefault:
self._setup_xcc_account(user, passwd, wc)
wc = self.wc
self._convert_sha256account(user, passwd, wc)
cd = self.configmanager.get_node_attributes(
nodename, ['secret.hardwaremanagementuser',
@@ -519,6 +536,20 @@ class NodeHandler(immhandler.NodeHandler):
_, _ = nwc.grab_json_response_with_status(
'/redfish/v1/Managers/1/NetworkProtocol',
{'IPMI': {'ProtocolEnabled': True}}, method='PATCH')
rsp, status = nwc.grab_json_response_with_status(
'/redfish/v1/AccountService/Accounts/1')
if status == 200:
allowable = rsp.get('AccountTypes@Redfish.AllowableValues', [])
current = rsp.get('AccountTypes', [])
if 'IPMI' in allowable and 'IPMI' not in current:
current.append('IPMI')
updateinf = {
'AccountTypes': current,
'Password': self._currcreds[1]
}
rsp, status = nwc.grab_json_response_with_status(
'/redfish/v1/AccountService/Accounts/1',
updateinf, method='PATCH')
if ('hardwaremanagement.manager' in cd and
cd['hardwaremanagement.manager']['value'] and
not cd['hardwaremanagement.manager']['value'].startswith(
@@ -124,19 +124,21 @@ class SshShell(conapi.Console):
self.ssh.set_missing_host_key_policy(
HostKeyHandler(self.nodeconfig, self.node))
try:
self.datacallback('\r\nConnecting to {}...'.format(self.node))
self.ssh.connect(self.node, username=self.username,
password=self.password, allow_agent=False,
look_for_keys=False)
except paramiko.AuthenticationException:
except paramiko.AuthenticationException as e:
self.ssh.close()
self.inputmode = 0
self.username = b''
self.password = b''
self.datacallback('\r\nError connecting to {0}:\r\n {1}\r\n'.format(self.node, str(e)))
self.datacallback('\r\nlogin as: ')
return
except paramiko.ssh_exception.NoValidConnectionsError as e:
self.ssh.close()
self.datacallback(str(e))
self.datacallback('\r\nError connecting to {0}:\r\n {1}\r\n'.format(self.node, str(e)))
self.inputmode = 0
self.username = b''
self.password = b''
@@ -162,10 +164,20 @@ class SshShell(conapi.Console):
'and permissions on /etc/ssh/*key)\r\n' \
'Press Enter to close...'
self.datacallback('\r\n' + warn)
return
except Exception as e:
self.ssh.close()
self.ssh.close()
self.inputmode = 0
self.username = b''
self.password = b''
warn = 'Error connecting to {0}:\r\n {1}\r\n'.format(self.node, str(e))
self.datacallback('\r\n' + warn)
self.datacallback('\r\nlogin as: ')
return
self.inputmode = 2
self.connected = True
self.datacallback('Connected\r\n')
self.shell = self.ssh.invoke_shell(width=self.width,
height=self.height)
self.rxthread = eventlet.spawn(self.recvdata)
+11 -1
View File
@@ -10,6 +10,7 @@ import eventlet.green.socket as socket
import eventlet.green.subprocess as subprocess
import confluent.discovery.handlers.xcc as xcc
import confluent.discovery.handlers.tsm as tsm
import confluent.discovery.core as disco
import base64
import hmac
import hashlib
@@ -112,7 +113,6 @@ def handle_request(env, start_response):
start_response('401', [])
yield 'Unauthorized'
return
ea = cfg.get_node_attributes(nodename, ['crypted.selfapikey', 'deployment.apiarmed'])
eak = ea.get(
nodename, {}).get('crypted.selfapikey', {}).get('hashvalue', None)
@@ -152,6 +152,16 @@ def handle_request(env, start_response):
operation = env['REQUEST_METHOD']
if operation not in ('HEAD', 'GET') and 'CONTENT_LENGTH' in env and int(env['CONTENT_LENGTH']) > 0:
reqbody = env['wsgi.input'].read(int(env['CONTENT_LENGTH']))
if env['PATH_INFO'] == '/self/register_discovered':
rb = json.loads(reqbody)
addrs = rb.get('addresses', [])
rb['addresses'] = []
for addr in addrs:
rb['addresses'].append(tuple(addr))
disco.detected(rb)
start_response('200 OK', [])
yield 'Registered'
return
if env['PATH_INFO'] == '/self/bmcconfig':
hmattr = cfg.get_node_attributes(nodename, 'hardwaremanagement.*')
hmattr = hmattr.get(nodename, {})
@@ -41,6 +41,10 @@ class _ShellHandler(consoleserver.ConsoleHandler):
return
#return super().feedbuffer(data)
def get_recent(self):
retdata, connstate = super(_ShellHandler, self).get_recent()
return '', connstate
def _got_disconnected(self):
self.connectstate = 'closed'
self._send_rcpts({'connectstate': self.connectstate})
+12 -15
View File
@@ -13,13 +13,17 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Requires: confluent_vtbufferd
%if "%{dist}" == ".el7"
Requires: python-pyghmi >= 1.0.34, python-eventlet, python-greenlet, python-pycryptodomex >= 3.4.7, confluent_client == %{version}, python-pyparsing, python-paramiko, python-dnspython, python-netifaces, python2-pyasn1 >= 0.2.3, python-pysnmp >= 4.3.4, python-lxml, python-eficompressor, python-setuptools, python-dateutil, python2-websocket-client python2-msgpack python-libarchive-c python-yaml python-monotonic
%else
%if "%{dist}" == ".el8"
Requires: python3-pyghmi >= 1.0.34, python3-eventlet, python3-greenlet, python3-pycryptodomex >= 3.4.7, confluent_client == %{version}, python3-pyparsing, python3-paramiko, python3-dns, python3-netifaces, python3-pyasn1 >= 0.2.3, python3-pysnmp >= 4.3.4, python3-lxml, python3-eficompressor, python3-setuptools, python3-dateutil, python3-enum34, python3-asn1crypto, python3-cffi, python3-pyOpenSSL, python3-monotonic, python3-websocket-client python3-msgpack python3-libarchive-c python3-yaml openssl iproute
%else
%if "%{dist}" == ".el9"
Requires: python3-pyghmi >= 1.0.34, python3-eventlet, python3-greenlet, python3-pycryptodomex >= 3.4.7, confluent_client == %{version}, python3-pyparsing, python3-paramiko, python3-dns, python3-netifaces, python3-pyasn1 >= 0.2.3, python3-pysnmp >= 4.3.4, python3-lxml, python3-eficompressor, python3-setuptools, python3-dateutil, python3-cffi, python3-pyOpenSSL, python3-websocket-client python3-msgpack python3-libarchive-c python3-yaml openssl iproute
%else
Requires: python-pyghmi >= 1.0.34, python-eventlet, python-greenlet, python-pycryptodomex >= 3.4.7, confluent_client == %{version}, python-pyparsing, python-paramiko, python-dnspython, python-netifaces, python2-pyasn1 >= 0.2.3, python-pysnmp >= 4.3.4, python-lxml, python-eficompressor, python-setuptools, python-dateutil, python2-websocket-client python2-msgpack python-libarchive-c python-yaml python-monotonic
Requires: python3-pyghmi >= 1.0.34, python3-eventlet, python3-greenlet, python3-pycryptodome >= 3.4.7, confluent_client == %{version}, python3-pyparsing, python3-paramiko, python3-dnspython, python3-netifaces, python3-pyasn1 >= 0.2.3, python3-pysnmp >= 4.3.4, python3-lxml, python3-eficompressor, python3-setuptools, python3-dateutil, python3-cffi, python3-pyOpenSSL, python3-websocket-client python3-msgpack python3-libarchive-c python3-PyYAML openssl iproute
%endif
%endif
%endif
Vendor: Jarrod Johnson <jjohnson2@lenovo.com>
@@ -32,25 +36,17 @@ Server for console management and systems management aggregation
%setup -n %{name}-%{version} -n %{name}-%{version}
%build
%if "%{dist}" == ".el8"
python3 setup.py build
%else
%if "%{dist}" == ".el9"
python3 setup.py build
%else
%if "%{dist}" == ".el7"
python2 setup.py build
%endif
%else
python3 setup.py build
%endif
%install
%if "%{dist}" == ".el8"
python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES.bare --install-purelib=/opt/confluent/lib/python --install-scripts=/opt/confluent/bin
%else
%if "%{dist}" == ".el9"
python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES.bare --install-purelib=/opt/confluent/lib/python --install-scripts=/opt/confluent/bin
%else
%if "%{dist}" == ".el7"
python2 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES.bare --install-purelib=/opt/confluent/lib/python --install-scripts=/opt/confluent/bin
%endif
%else
python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES.bare --install-purelib=/opt/confluent/lib/python --install-scripts=/opt/confluent/bin
%endif
for file in $(grep confluent/__init__.py INSTALLED_FILES.bare); do
rm $RPM_BUILD_ROOT/$file
@@ -101,3 +97,4 @@ rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%license /opt/confluent/share/licenses/confluent_server/LICENSE
%defattr(-,root,root)
/opt/confluent
+10
View File
@@ -0,0 +1,10 @@
import confluent.config.configmanager as cfm
import sys
c = cfm.ConfigManager(None)
cfg = c.get_node_attributes(sys.argv[1], 'secret.*', decrypt=True)
for node in cfg:
for attr in cfg[node]:
val = cfg[node][attr]['value']
if not isinstance(val, str):
val = val.decode('utf8')
print('{}: {}'.format(attr, val))
+18
View File
@@ -0,0 +1,18 @@
DEVICES="/dev/sda /dev/sdb"
RAIDLEVEL=1
mdadm --detail /dev/md*|grep 'Version : 1.0' >& /dev/null && exit 0
lvm vgchange -a n
mdadm -S -s
NUMDEVS=$(for dev in $DEVICES; do
echo wipefs -a $dev
done|wc -l)
for dev in $DEVICES; do
wipefs -a $dev
done
# must use older metadata format to leave disks looking normal for uefi
mdadm -C /dev/md/raid $DEVICES -n $NUMDEVS -e 1.0 -l $RAIDLEVEL
# shut and restart array to prime things for anaconda
mdadm -S -s
mdadm --assemble --scan
readlink /dev/md/raid|sed -e 's/.*\///' > /tmp/installdisk
+15
View File
@@ -0,0 +1,15 @@
DEVICES="/dev/sda /dev/sdb"
RAIDLEVEL=1
mdadm --detail /dev/md* | grep imsm >& /dev/null && exit 0
lvm vgchange -a n
mdadm -S -s
NUMDEVS=$(for dev in $DEVICES; do
echo wipefs -a $dev
done|wc -l)
for dev in $DEVICES; do
wipefs -a $dev
done
mdadm -C /dev/md/imsm0 $DEVICES -n $NUMDEVS -e imsm
mdadm -C /dev/md/md0_0 /dev/md/imsm0 -n $NUMDEVS -l $RAIDLEVEL
mdadm -S -s
mdadm --assemble --scan