Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prerequisites for running ansible inside the appliance #42

Merged
merged 2 commits into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/gems/pending/appliance_console/database_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ def friendly_inspect
def settings_hash
{
'adapter' => 'postgresql',
'host' => local? ? nil : host,
'port' => local? ? nil : port,
'host' => local? ? "localhost" : host,
'port' => port,
'username' => username,
'password' => local? ? nil : password.presence,
'password' => password.presence,
'database' => database
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ def create_postgres_root_user
conn = PG.connect(:user => "postgres", :dbname => "postgres")
esc_pass = conn.escape_string(password)
conn.exec("CREATE ROLE #{username} WITH LOGIN CREATEDB SUPERUSER PASSWORD '#{esc_pass}'")
conn.exec("CREATE ROLE awx WITH LOGIN PASSWORD '#{esc_pass}'")
end

def create_postgres_database
conn = PG.connect(:user => "postgres", :dbname => "postgres")
conn.exec("CREATE DATABASE #{database} OWNER #{username} ENCODING 'utf8'")
conn.exec("CREATE DATABASE awx OWNER awx ENCODING 'utf8'")
end

def relabel_postgresql_dir
Expand Down
6 changes: 0 additions & 6 deletions spec/appliance_console/database_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,6 @@ def say(*_args)
context "#merged_settings" do
subject { @config.merged_settings["production"] }

it "should remove host/password from previous values for localhost" do
@config.host = "localhost"
@config.port = "123"
expect(subject).not_to include("host", "port", "password")
end

it "should inherit unchanged non-core values" do
expect(subject).to include("encoding" => "utf8", "pools" => "5")
end
Expand Down