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 | |
| echo "" | |
| echo "DELETING All task data" | |
| echo "" | |
| TABLE_COUNTS="select count(*) as foreman_tasks_tasks from foreman_tasks_tasks; | |
| select count(*) as dynflow_execution_plans from dynflow_execution_plans; | |
| select count(*) as dynflow_actions from dynflow_actions; |
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 > /usr/share/foreman/config/initializers/foreman_tasks_workers_bump.rb | |
| workers_count = 10 | |
| Rails.logger.info("Bumping the number of dynflow worksers to #{workers_count}") | |
| ForemanTasks.dynflow.config.pool_size = workers_count | |
| EOF | |
| service foreman-tasks restart |
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 | |
| set -x | |
| #Stop Katello/Satellite services | |
| katello-service stop | |
| CERT=/etc/pki/katello/certs/katello-apache.crt | |
| KEY=/etc/pki/katello/private/katello-apache.key |
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
| On your Satellite server | |
| # foreman-rake console | |
| ... | |
| User.current = User.first | |
| ForemanTasks.async_task(::Actions::Katello::Repository::MetadataGenerate, Katello::Repository.where(pulp_id: "Ten_Capsule_Org-Dev-demo-repos-Demo-demo3").first) |
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 | |
| # 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 | |
| echo "" | |
| echo "DELETING All tasks and associated data from [$DAYS_AGO] days ago" | |
| echo "" |
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
| irb(main):002:0> User.current = User.anonymous_admin | |
| => #<User id: 1, login: "foreman_admin", firstname: "Anonymous", lastname: "Admin", mail: nil, admin: true, | |
| irb(main):003:0> Katello::Repository.where(id: 1317) | |
| => #<ActiveRecord::Relation [#<Katello::Repository id: 1317, name: "Red Hat Satellite 6.2 for RHEL 7 Server RPMs x86_6 | |
| irb(main):004:0> ForemanTasks.sync_task(::Actions::Katello::Repository::MetadataGenerate, Katello::Repository.where(id: 1317).first) | |
| => #<ForemanTasks::Task::DynflowTask id: "5170d237-7c78-46d3-8df9-55790413af92", type: "ForemanTasks::Task::DynflowTask", label: | |
| irb(main):005:0> |
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
| for i in $(hammer repository list --organization-id 1 | grep -e "^[[:digit:]]" | awk '{print $1}' | sort -n); do hammer repository update --id $i --download-policy 'on_demand' --organization-id 1; done |
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
| # /etc/candlepin/candlepin.conf | |
| candlepin.auth.basic.enable=true | |
| candlepin.auth.trusted.enable=true | |
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
| # for each of such $queue: | |
| # rm -rf /var/lib/qpidd/.qpidd/qls/jrnl/${queue} | |
| # qpid-config --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b amqps://localhost:5671 add queue $queue --durable |
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
| mongo pulp_database --eval "db.units_distribution.drop();db.units_docker_blob.drop();db.units_docker_image.drop();db.units_docker_manifest.drop();db.units_docker_tag.drop();db.units_drpm.drop();db.units_erratum.drop();db.units_iso.drop();db.units_package_category.drop();db.units_package_environment.drop();db.units_package_group.drop();db.units_puppet_module.drop();db.units_rpm.drop();db.units_srpm.drop();db.units_yum_repo_metadata_file.drop();db.repo_content_units.drop();" | |
| mongo pulp_database --eval 'db.repo_importers.update({"scratchpad": {$ne: null}}, {$set: {"scratchpad.repomd_revision": null}}, {"multi":true})' | |
| rm -rf /var/lib/pulp/content/units/* |