Seite 1 von 1

zweites Depot durch Domainjoin -> wie löschen

Verfasst: 24 Mär 2020, 17:49
von Linuxuser
Hallo Leute,

ich hoffe Ihr könnt mir helfen.

Ich habe einen OPS4.1 am laufen und habe nachträglich einen Domainjoin mit dem Linux durchgeführt.
Dabei hat sich die Domain leicht verändert.

Jetzt habe ich in meinem Depo auf einmal zwei Depots zur Auswahl.
Wie bekomme ich das neue Depot wieder raus, will das alte behalten?!

Alt und korrekt = hackl-opsi.hackl.internal
Neu und doof = hackl-opsi.hackl-cb.internal

Code: Alles auswählen

root@hackl-opsi 7.0:/etc/opsi# opsi-admin -d method host_getObjects [] '{"type":"OpsiDepotserver"}'
[
    {
        "masterDepotId": null,
        "ident": "hackl-opsi.hackl.internal",
        "networkAddress": "10.125.150.0/255.255.255.0",
        "description": "",
        "inventoryNumber": "",
        "ipAddress": "10.125.150.17",
        "repositoryRemoteUrl": "webdavs://10.125.150.17:4447/repository",
        "depotLocalUrl": "file:///var/lib/opsi/depot",
        "isMasterDepot": true,
        "workbenchLocalUrl": "file:///var/lib/opsi/workbench",
        "workbenchRemoteUrl": "smb://10.125.150.17/opsi_workbench",
        "notes": "",
        "hardwareAddress": "00:16:3e:5e:99:77",
        "maxBandwidth": 0,
        "repositoryLocalUrl": "file:///var/lib/opsi/repository",
        "opsiHostKey": null,
        "type": "OpsiDepotserver",
        "id": "hackl-opsi.hackl.internal",
        "depotWebdavUrl": "webdavs://10.125.150.17:4447/depot",
        "depotRemoteUrl": "smb://10.125.150.17/opsi_depot"
    },
    {
        "masterDepotId": null,
        "ident": "hackl-opsi.hackl-cb.internal",
        "networkAddress": "10.125.150.0/255.255.255.0",
        "description": "",
        "inventoryNumber": "",
        "ipAddress": "10.125.150.17",
        "repositoryRemoteUrl": "webdavs://10.125.150.17:4447/repository",
        "depotLocalUrl": "file:///var/lib/opsi/depot",
        "isMasterDepot": true,
        "workbenchLocalUrl": "file:///var/lib/opsi/workbench",
        "workbenchRemoteUrl": "smb://10.125.150.17/opsi_workbench",
        "notes": "",
        "hardwareAddress": "00:16:3e:5e:99:77",
        "maxBandwidth": 0,
        "repositoryLocalUrl": "file:///var/lib/opsi/repository",
        "opsiHostKey": "f0ebf7b5f38bdf0cd7b6e0111442d661",
        "type": "OpsiConfigserver",
        "id": "hackl-opsi.hackl-cb.internal",
        "depotWebdavUrl": "webdavs://10.125.150.17:4447/depot",
        "depotRemoteUrl": "smb://10.125.150.17/opsi_depot"
    }
]
Wenn ich die falsche depot ini unter "/var/lib/opsi/config/depots" lösche und ein "opsi-setup --cleanup-backend" durchführe
ist das depot weg, jedoch klappt weder der der updater noch der opsi-package-manager

Code: Alles auswählen

root@hackl-opsi 7.0:/var/lib/opsi/config/depots# opsi-package-manager -l
ERROR: Depot 'hackl-opsi.hackl-cb.internal' not in list of known depots: hackl-opsi.hackl.internal
Ein init-config bringt das depot wieder zurück.

So wie bekomme ich das neue/falsche Depot aus dem Server?

Danke schonmal für Eure Vorschläge

Gruß

Re: zweites Depot durch Domainjoin -> wie löschen

Verfasst: 31 Mär 2020, 11:07
von Linuxuser
Hallo Leute,

keiner von Euch eine Idee?

Merci

Re: zweites Depot durch Domainjoin -> wie löschen

Verfasst: 02 Apr 2020, 17:52
von SirTux
Sicherer wäre vermutlich ein Backup zu bemühen. Sonst wirst du wohl direkt am offenen Herzen operieren müssen. Falls du das File-Backend hast: Schau mal in /var/lib/opsi/config/.

Re: zweites Depot durch Domainjoin -> wie löschen

Verfasst: 03 Apr 2020, 13:04
von Admini
Moin moin,

vielleicht hilft dir dieser Beitrag:

viewtopic.php?t=2454

LG

Re: zweites Depot durch Domainjoin -> wie löschen

Verfasst: 07 Apr 2020, 15:12
von Linuxuser
Hallo Admini, Hallo SirTux,

keine Reaktion auf

root@hackl-opsi 7.0:~# opsi-admin -d method host_delete "hackl-opsi.hackl-cb.internal" -> Getestet mit und ohne ""

Depot ist danach immer noch da

Code: Alles auswählen

root@hackl-opsi 7.0:~# opsi-admin -d method host_getObjects [] '{"type":"OpsiDepotserver"}'
[
    {
        "masterDepotId": null,
        "ident": "hackl-opsi.hackl.internal",
        "networkAddress": "10.125.150.0/255.255.255.0",
        "description": "",
        "inventoryNumber": "",
        "ipAddress": "10.125.150.17",
        "repositoryRemoteUrl": "webdavs://10.125.150.17:4447/repository",
        "depotLocalUrl": "file:///var/lib/opsi/depot",
        "isMasterDepot": true,
        "workbenchLocalUrl": "file:///var/lib/opsi/workbench",
        "workbenchRemoteUrl": "smb://10.125.150.17/opsi_workbench",
        "notes": "",
        "hardwareAddress": "00:16:3e:5e:99:77",
        "maxBandwidth": 0,
        "repositoryLocalUrl": "file:///var/lib/opsi/repository",
        "opsiHostKey": null,
        "type": "OpsiDepotserver",
        "id": "hackl-opsi.hackl.internal",
        "depotWebdavUrl": "webdavs://10.125.150.17:4447/depot",
        "depotRemoteUrl": "smb://10.125.150.17/opsi_depot"
    },
    {
        "masterDepotId": null,
        "ident": "hackl-opsi.hackl-cb.internal",
        "networkAddress": "10.125.150.0/255.255.255.0",
        "description": "",
        "inventoryNumber": "",
        "ipAddress": "10.125.150.17",
        "repositoryRemoteUrl": "webdavs://10.125.150.17:4447/repository",
        "depotLocalUrl": "file:///var/lib/opsi/depot",
        "isMasterDepot": true,
        "workbenchLocalUrl": "file:///var/lib/opsi/workbench",
        "workbenchRemoteUrl": "smb://10.125.150.17/opsi_workbench",
        "notes": "",
        "hardwareAddress": "00:16:3e:5e:99:77",
        "maxBandwidth": 0,
        "repositoryLocalUrl": "file:///var/lib/opsi/repository",
        "opsiHostKey": null,
        "type": "OpsiConfigserver",
        "id": "hackl-opsi.hackl-cb.internal",
        "depotWebdavUrl": "webdavs://10.125.150.17:4447/depot",
        "depotRemoteUrl": "smb://10.125.150.17/opsi_depot"
    }
]
@SirTux
hatte die *falsche* ini gelöscht und ein init-config durchgeführt -> Dann ist es wieder da

Re: zweites Depot durch Domainjoin -> wie löschen

Verfasst: 07 Apr 2020, 15:17
von Linuxuser
und somit gehen nun auch keine Updates mehr aus dem Repo :evil:

Code: Alles auswählen

root@hackl-opsi 7.0:/etc/opsi/package-updater.repos.d# opsi-package-updater -vv update
Zsync command found: /usr/bin/zsync
Executing: /bin/pidof -x opsi-package-updater
Using encoding 'UTF-8'
We are the only opsi-package-updater running.
* BackendManager is creating BackendDispatcher
Backend context was set to <BackendManager()>
Loading dispatch config file '/etc/opsi/backendManager/dispatch.conf'
Loading backend config '/etc/opsi/backends/opsipxeconfd.conf'
Backend context was set to <BackendDispatcher(dispatchConfigFile=u'/etc/opsi/backendManager/dispatch.conf', context=<BackendManager()>)>
Loading backend config '/etc/opsi/backends/file.conf'
Backend context was set to <BackendDispatcher(dispatchConfigFile=u'/etc/opsi/backendManager/dispatch.conf', context=<BackendManager()>)>
Loading backend config '/etc/opsi/backends/mysql.conf'
Backend context was set to <BackendDispatcher(dispatchConfigFile=u'/etc/opsi/backendManager/dispatch.conf', context=<BackendManager()>)>
Failed to read opsi modules file '/etc/opsi/modules': [Errno 2] No such file or directory: u'/etc/opsi/modules'
Missing important information about modules. Probably no modules file installed.
* BackendManager is creating ExtendedConfigDataBackend
Setting context to backend <ExtendedConfigDataBackend(configDataBackend=<BackendDispatcher(dispatchConfigFile=u'/etc/opsi/backendManager/dispatch.conf', context=<BackendManager()>)>)>
* BackendManager is creating DepotserverBackend
Setting context to backend <DepotserverBackend()>
* BackendManager is creating HostControlBackend
Setting context to backend <HostControlBackend()>
* BackendManager is creating BackendExtender
Setting context to backend <BackendExtender()>
Reading config file '/etc/opsi/backendManager/extend.d/10_opsi.conf'
Reading config file '/etc/opsi/backendManager/extend.d/10_wim.conf'
Reading config file '/etc/opsi/backendManager/extend.d/20_easy.conf'
Reading config file '/etc/opsi/backendManager/extend.d/20_legacy.conf'
Reading config file '/etc/opsi/backendManager/extend.d/30_kiosk.conf'
Reading config file '/etc/opsi/backendManager/extend.d/30_sshcommands.conf'
Reading config file '/etc/opsi/backendManager/extend.d/40_admin_tasks.conf'
Reading config file '/etc/opsi/backendManager/extend.d/40_groupActions.conf'
Reading config file '/etc/opsi/backendManager/extend.d/45_deprecated.conf'
Reading config file '/etc/opsi/backendManager/extend.d/70_dynamic_depot.conf'
Reading config file '/etc/opsi/backendManager/extend.d/70_wan.conf'
Traceback:
  File "/usr/bin/opsi-package-updater", line 341, in <module>
    exitCode = main()

  File "/usr/bin/opsi-package-updater", line 310, in main
    with OpsiPackageUpdaterClient(config) as opu:

  File "/usr/lib/python2.7/dist-packages/OPSI/Util/Task/UpdatePackages/Updater.py", line 80, in __init__
    raise ValueError(u"Opsi host key for depot '%s' not found in backend" % self.depotId)

     ==>>> Opsi host key for depot 'hackl-opsi.hackl-cb.internal' not found in backend
ERROR: Opsi host key for depot 'hackl-opsi.hackl-cb.internal' not found in backend

Re: zweites Depot durch Domainjoin -> wie löschen

Verfasst: 08 Apr 2020, 10:49
von Linuxuser
So wurde nun gelöst mit

Code: Alles auswählen

 1823  2020-04-08 09:17:35 root@hackl-opsi systemctl  opsiconfd stop
 1825  2020-04-08 09:17:53 root@hackl-opsi systemctl  stop opsipxeconfd

 1834  2020-04-08 09:23:30 root@hackl-opsi rm /var/lib/opsi/config/depots/hackl-opsi.hackl-cb.internal.ini
 1835  2020-04-08 09:23:33 root@hackl-opsi opsi-admin -d --no-depot method host_renameOpsiDepotserver hackl-opsi.hackl.internal hackl-opsi.hackl-cb.internal

 1836  2020-04-08 09:28:45 root@hackl-opsi systemctl start opsiconfd.service
 1837  2020-04-08 09:29:12 root@hackl-opsi systemctl start opsipxeconfd
Damit habe ich nur noch ein Depot