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
SCRATCH_REPO=http://inecas.fedorapeople.org/dynflow-scratch/ | |
# Install Katello as usual + following commands before katello-intaller | |
yum install -y\ | |
$SCRATCH_REPO/ruby193-rubygem-algebrick-0.4.0-2.el6.noarch.rpm\ | |
$SCRATCH_REPO/ruby193-rubygem-apipie-params-0.0.3-1.el6.noarch.rpm\ | |
$SCRATCH_REPO/ruby193-rubygem-dynflow-0.2.0-1.git.0.03c40d9.el6.noarch.rpm\ | |
$SCRATCH_REPO/ruby193-rubygem-foreman-tasks-0.1.3-1.el6.noarch.rpm |
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
require 'zeus/rails' | |
class CustomPlan < Zeus::Rails | |
# def my_custom_command | |
# # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md | |
# end | |
def test_environment | |
require 'minitest/unit' | |
MiniTest::Unit.class_variable_set("@@installed_at_exit", 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
gem 'zeus' |
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
class Hell | |
attr_accessor :temperature | |
end | |
hell = Hell.new | |
hell.temperature = 100 | |
hell.freeze | |
hell.temperature = 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
Vagrant.configure("2") do |config| | |
config.vm.define "my-db-fedora" do |vm| | |
vm.box = "chef/fedora-21" | |
vm.provision "ansible" do | |
ansible.groups = { 'ha' => 'my-ha-fedora' } | |
ansible.playbook = "my-db.yml" | |
end | |
end | |
config.vm.define "my-ha-fedora" do |vm| |
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
import os | |
from datetime import datetime | |
import json | |
import uuid | |
TIME_FORMAT="%Y-%m-%d_%H%M%S_%f" | |
FILE_NAME_FORMAT="%(now)s-%(host)s.json" | |
MSG_FORMAT='{"host":"%(host)s","timestamp":"%(now)s", "category":"%(category)s", "data": %(data)s}' + "\n" | |
LOG_DIR="/tmp/ansible/events" | |
AGGREGATION_KEY = uuid.uuid4().hex |
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 | |
@world = ForemanTasks.dynflow.world | |
@persistence = @world.persistence | |
def reset_pulp_task(uuid) | |
execution_plan = @persistence.load_execution_plan(uuid) | |
raise 'execution plan #{execution_plan} is not paused' unless execution_plan.state == :paused | |
active_steps = execution_plan.steps_in_state(:running, :suspended, :error) | |
active_steps.each do |step| | |
action = step.action(execution_plan) |
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
gem 'smart_proxy_dynflow', :git => '[email protected]:iNecas/smart_proxy_dynflow.git', :branch => 'integrate-foreman-tasks-core' | |
gem 'smart_proxy_dynflow_core', :git => '[email protected]:iNecas/smart_proxy_dynflow.git', :branch => 'integrate-foreman-tasks-core' | |
gem 'foreman-tasks-core', :git => '[email protected]:iNecas/foreman-tasks.git', :branch => 'foreman-tasks-core' | |
gem 'smart_proxy_ansible', :git => '[email protected]:iNecas/smart_proxy_ansible.git', :branch => 'ansible-run-rebase' | |
gem 'foreman_ansible_core', :git => '[email protected]:iNecas/foreman_ansible.git', :branch => 'run-via-proxy' |
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
#!/usr/bin/env bash | |
function export-csv () { | |
echo "Exporting $2" | |
echo "COPY ($1) TO STDOUT WITH CSV;" | su - postgres -c '/usr/bin/psql -d foreman' > $2 | |
} | |
function import-csv () { | |
echo "Importing $2" | |
su - postgres -c "/usr/bin/psql -d $IMPORT_DATABASE -c 'COPY $1 FROM STDIN WITH CSV'" <$2 |
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
diff --git a/app/lib/actions/remote_execution/run_hosts_job.rb b/app/lib/actions/remote_execution/run_hosts_job.rb | |
index 40dd320..c146ea8 100644 | |
--- a/app/lib/actions/remote_execution/run_hosts_job.rb | |
+++ b/app/lib/actions/remote_execution/run_hosts_job.rb | |
@@ -25,7 +25,7 @@ module Actions | |
job_invocation = JobInvocation.find(input[:job_invocation_id]) | |
proxy_selector = RemoteExecutionProxySelector.new | |
- ::Host.where(:id => current_batch).map do |host| | |
+ current_batch.map do |host| |