This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat <<EOF | foreman-rake console | |
| persistence = ForemanTasks.dynflow.world.persistence | |
| adapter = persistence.adapter | |
| batch_size = 5 | |
| total = adapter.db.fetch("select count(dynflow_execution_plans.uuid) from dynflow_execution_plans left join foreman_tasks_tasks on (dynflow_execution_plans.uuid = foreman_tasks_tasks.external_id) where foreman_tasks_tasks.id IS NULL").first[:count] | |
| deleted = 0 | |
| puts "about to delete #{total} execution plans" | |
| while (plans_without_tasks = adapter.db.fetch("select dynflow_execution_plans.uuid from dynflow_execution_plans left join foreman_tasks_tasks on (dynflow_execution_plans.uuid = foreman_tasks_tasks.external_id) where foreman_tasks_tasks.id IS NULL LIMIT #{batch_size}").all.map { |x| x[:uuid] }) && !plans_without_tasks.empty? | |
| persistence.delete_execution_plans({ 'uuid' => plans_without_tasks }, batch_size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ################################### | |
| # USAGE: | |
| # ./subs-export.csv.bash <ORG NAME> | |
| # | |
| # NOTE: If you run this without the | |
| # organization name as a parameter | |
| # it will return 0 results. | |
| ################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Delete all paused | |
| foreman-rake foreman_tasks:cleanup TASK_SEARCH='label ~ *' AFTER='0d' STATES=paused VERBOSE=true | |
| # Delete all stopped | |
| foreman-rake foreman_tasks:cleanup TASK_SEARCH='label ~ *' AFTER='0d' STATES=stopped VERBOSE=true | |
| # Delete everything |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| SIZES="SELECT relname AS objectname, | |
| relkind AS objecttype, | |
| reltuples AS "entries", pg_size_pretty(relpages::bigint*8*1024) AS size | |
| FROM pg_class | |
| WHERE relpages >= 8 | |
| ORDER BY relpages DESC;" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TABLE_COUNTS="select count(*) as foreman_tasks_tasks from foreman_tasks_tasks; | |
| select count(*) as foreman_tasks_locks from foreman_tasks_locks; | |
| select count(*) as dynflow_execution_plans from dynflow_execution_plans; | |
| select count(*) as dynflow_actions from dynflow_actions; | |
| select count(*) as dynflow_steps from dynflow_steps;" | |
| echo "" | |
| echo "Table counts :" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pre><font color="#06989A"><b>Upgrade Step: correct_repositories (this may take a while) ...</b></font> | |
| <font color="#CC0000"><b>rake aborted!</b></font> | |
| <font color="#CC0000"><b>Not all the services have been started. Check the status report above and try again.</b></font> | |
| <font color="#CC0000"><b>/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.158/lib/katello/tasks/reimport.rake:8:in `block (2 levels) in <top (required)>'</b></font> | |
| <font color="#CC0000"><b>Tasks: TOP => katello:correct_repositories => katello:check_ping</b></font> | |
| <font color="#CC0000"><b>(See full trace by running task with --trace)</b></font> | |
| <font color="#CC0000"><b>{:status=>"FAIL",</b></font> | |
| <font color="#CC0000"><b> :services=></b></font> | |
| <font color="#CC0000"><b> {:pulp=>{:status=>"ok", :duration_ms=>"46"},</b></font> | |
| <font color="#CC0000"><b> :pulp_auth=>{:status=>"ok", :duration_ms=>"57"},</b></font> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1) stop services: | |
| # katello-service stop | |
| # systemctl start postgresql | |
| 2) Upgrade RPMs | |
| # yum update candlepin candlepin-tomcat candlepin-selinux | |
| 3) Update the candlepin database: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yum -y install pcp pcp-system-tools | |
| systemctl start pmcd pmlogger | |
| systemctl enable pmcd pmlogger | |
| subscription-manager repos --enable rhel-7-server-optional-rpms | |
| yum -y install pcp-webapi pcp-webapp-grafana \ | |
| pcp-webapp-graphite pcp-webapp-vector | |
| systemctl start pmwebd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin | |
| # This will delete all tasks and associated task data from anything older than | |
| # the number of days specified below defaulting to 120 days. | |
| #DAYS_AGO=120 | |
| DAYS_AGO=16 | |
| echo "" | |
| echo "DELETING All tasks and associated data from [$DAYS_AGO] days ago" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| git clone https://github.com/iNecas/ownca.git | |
| cd ownca | |
| yes "" | ./generate-ca.sh | |
| yes | ./generate-crt.sh $(hostname) | |
| certdir="$(pwd)/$(hostname)/" | |
| cp cacert.crt $(hostname)/ | |
| cd $(hostname) | |
| katello-certs-check -c "$(hostname).crt" -k "$(hostname).key" -r "$(hostname).crt.req" -b cacert.crt |