Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
247 additions
and
98 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
engines: | ||
brakeman: | ||
enabled: true | ||
duplication: | ||
enabled: true | ||
config: | ||
languages: | ||
- ruby | ||
- javascript | ||
- python | ||
- php | ||
fixme: | ||
enabled: true | ||
radon: | ||
enabled: true | ||
rubocop: | ||
enabled: true | ||
checks: | ||
Rubocop/Style/PercentLiteralDelimiters: | ||
enabled: false # it's outdated vs rubocop | ||
ratings: | ||
paths: | ||
- Gemfile.lock | ||
- "**.erb" | ||
- "**.haml" | ||
- "**.rb" | ||
- "**.rhtml" | ||
- "**.slim" | ||
- "**.inc" | ||
- "**.js" | ||
- "**.jsx" | ||
- "**.module" | ||
- "**.php" | ||
- "**.py" | ||
exclude_paths: | ||
- config/ | ||
- db/ | ||
- test/ |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
13 changes: 9 additions & 4 deletions
13
db/migrate/20161122154057_automatically_set_role_timestamps.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
# Creation and updates timestamps for Ansible Roles | ||
class AutomaticallySetRoleTimestamps < ActiveRecord::Migration | ||
def up | ||
change_column :ansible_roles, :created_at, :datetime, :null => true, :default => nil | ||
change_column :ansible_roles, :updated_at, :datetime, :null => true, :default => nil | ||
change_column :ansible_roles, :created_at, :datetime, :null => true, | ||
:default => nil | ||
change_column :ansible_roles, :updated_at, :datetime, :null => true, | ||
:default => nil | ||
end | ||
|
||
def down | ||
change_column :ansible_roles, :created_at, :datetime, :null => false, :default => Time.now.utc | ||
change_column :ansible_roles, :updated_at, :datetime, :null => false, :default => Time.now.utc | ||
change_column :ansible_roles, :created_at, :datetime, | ||
:null => false, :default => Time.now.utc | ||
change_column :ansible_roles, :updated_at, :datetime, | ||
:null => false, :default => Time.now.utc | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module ForemanAnsibleCore | ||
# Creates the actual command to be passed to foreman_tasks_core to run | ||
class CommandCreator | ||
attr_reader :command | ||
|
||
def initialize(inventory_file, playbook_file, options = {}) | ||
@options = options | ||
@command = [{ 'JSON_INVENTORY_FILE' => inventory_file }] | ||
@command << 'ansible-playbook' | ||
@command = command_options(@command) | ||
@command << playbook_file | ||
end | ||
|
||
private | ||
|
||
def command_options(command) | ||
command.concat(['-i', json_inventory_script]) | ||
command.concat([setup_verbosity]) if verbose? | ||
command.concat(['-T', @options[:timeout]]) unless @options[:timeout].nil? | ||
command | ||
end | ||
|
||
def json_inventory_script | ||
File.expand_path('../../bin/json_inventory.sh', File.dirname(__FILE__)) | ||
end | ||
|
||
def setup_verbosity | ||
verbosity_level = @options[:verbosity_level].to_i | ||
verbosity = '-' | ||
verbosity_level.times do | ||
verbosity += 'v' | ||
end | ||
verbosity | ||
end | ||
|
||
def verbose? | ||
verbosity_level = @options[:verbosity_level] | ||
# rubocop:disable Rails/Present | ||
!verbosity_level.nil? && !verbosity_level.empty? && | ||
verbosity_level.to_i > 0 | ||
end | ||
end | ||
end |
Oops, something went wrong.