Skip to main content

Posts

Showing posts from May, 2022

Foreman - Stop stuck tasks in bulk using foreman-rake

First of all, make sure you have a working backup since this method is potentially destructive! I am not responsible for any data loss or broken configurations in your environment. I've run into a situation where multiple tasks (~8.000) tasks were stuck in execution over the course of a week. Canceling them by hand will take me forever and the WebUI is non-responsive when selecting this amount of tasks, so foreman-rake to the rescue it is. Start by finding out the label of the process you are going to stop: [root@katello ~]# su - postgres -c "psql -d foreman -c 'select label,state,result from foreman_tasks_tasks where state = '\''running'\'' and result = '\''pending'\''';" For me the label was 'Actions::RemoteExecution::RunHostJob'. Here're all the details I was searching for using foreman-rake: label: 'Actions::RemoteExecution::RunHostJob' state: 'running' or 'pending' result:

FreeIPA - Reset directory manager password

When inheriting environments, documentation might not be complete and you'll have to reset administrative passwords. In this example, I'll talk about resetting the password for 'cn=Directory Manager' in a FreeIPA setup. I'll be using a replica based on EL8, although the steps should be the same for EL7 and EL9. First, stop the ipa services on the node: [root@ipa01 ~]# ipactl stop Next, create a backup of the current configuration, you know ... just in case anything goes wrong: [root@ipa01 ~]# cp /etc/dirsrv/slapd-ARCHYSLIFE.LAN/dse.ldif /root/dse.ldif.$(date +%F) Now, create a new hash that will replace the current value: [root@ipa01 ~]# pwdhash -s 'SSHA512' 'my_new_supersecure_adminpw' {SSHA512}BdvV0vQ31PBBCjRIXlxl1Ba4xRI/rNNDquWICfP3fO0CPTADgDmtBJGoSgfLIwPPnIV7LWDJLcCXDy96eQJhckKpcNmDZHXd The password hash is stored in '/etc/dirsrv/slapd-ARCHYSLIFE.LAN/dse.ldif', so we'll have to edit it: [root@ipa01 ~]# vim /etc/dirsrv/sl