manageiq-appliance_console 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/manageiq/appliance_console/database_maintenance.rb +1 -1
- data/lib/manageiq/appliance_console/database_maintenance_hourly.rb +1 -1
- data/lib/manageiq/appliance_console/database_replication.rb +1 -1
- data/lib/manageiq/appliance_console/date_time_configuration.rb +1 -1
- data/lib/manageiq/appliance_console/internal_database_configuration.rb +17 -16
- data/lib/manageiq/appliance_console/logical_volume_management.rb +8 -3
- data/lib/manageiq/appliance_console/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ed41ad025c3f0f288361b95b827806b630519a9d7d14dbb708fbb6737754a9f
|
4
|
+
data.tar.gz: 7a12bc4a13675a1350f8df4b9ded7500da77b03638ba3412d64857e958aa783b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36860fdccb66a1e153a848e2c5e579bfcd802685e25fd32bdf13cbd1c2a78b3723b59733267cb4b38a5f86e954ae4bcb8bf182c7de675daf92b2ba0f44c185c1
|
7
|
+
data.tar.gz: 361a36c04caece0df425490174477a2a70af553cf56ebee7764656f561a99577adc0be7cdf63f09b49818bdd0949400442c0da5b9a1ba846a0e9fff4ccb62ff7
|
@@ -30,6 +30,6 @@ module ApplianceConsole
|
|
30
30
|
self.executed_periodic_action = periodic.activate
|
31
31
|
executed_hourly_action || executed_periodic_action
|
32
32
|
end
|
33
|
-
end # class DatabaseMaintenance
|
33
|
+
end # class DatabaseMaintenance
|
34
34
|
end # module ApplianceConsole
|
35
35
|
end
|
@@ -6,7 +6,7 @@ require "linux_admin"
|
|
6
6
|
module ManageIQ
|
7
7
|
module ApplianceConsole
|
8
8
|
class InternalDatabaseConfiguration < DatabaseConfiguration
|
9
|
-
attr_accessor :disk, :
|
9
|
+
attr_accessor :disk, :run_as_evm_server
|
10
10
|
|
11
11
|
DEDICATED_DB_SHARED_BUFFERS = "'1GB'".freeze
|
12
12
|
SHARED_DB_SHARED_BUFFERS = "'128MB'".freeze
|
@@ -88,6 +88,7 @@ module ApplianceConsole
|
|
88
88
|
log_and_feedback(__method__) do
|
89
89
|
PostgresAdmin.prep_data_directory
|
90
90
|
run_initdb
|
91
|
+
configure_ssl
|
91
92
|
relabel_postgresql_dir
|
92
93
|
configure_postgres
|
93
94
|
start_postgres
|
@@ -98,10 +99,8 @@ module ApplianceConsole
|
|
98
99
|
end
|
99
100
|
|
100
101
|
def configure_postgres
|
101
|
-
self.ssl = File.exist?(PostgresAdmin.certificate_location.join("postgres.key"))
|
102
|
-
|
103
102
|
copy_template "postgresql.conf"
|
104
|
-
copy_template "pg_hba.conf
|
103
|
+
copy_template "pg_hba.conf"
|
105
104
|
copy_template "pg_ident.conf"
|
106
105
|
end
|
107
106
|
|
@@ -115,14 +114,8 @@ module ApplianceConsole
|
|
115
114
|
PostgresAdmin.mount_point
|
116
115
|
end
|
117
116
|
|
118
|
-
def copy_template(src
|
119
|
-
|
120
|
-
if src.include?(".erb")
|
121
|
-
full_dest = dest_dir.join(src.gsub(".erb", ""))
|
122
|
-
File.open(full_dest, "w") { |f| f.puts ERB.new(File.read(full_src), nil, '-').result(binding) }
|
123
|
-
else
|
124
|
-
FileUtils.cp full_src, dest_dir
|
125
|
-
end
|
117
|
+
def copy_template(src)
|
118
|
+
FileUtils.cp(self.class.postgresql_template.join(src), PostgresAdmin.data_directory)
|
126
119
|
end
|
127
120
|
|
128
121
|
def pg_mount_point?
|
@@ -175,13 +168,21 @@ module ApplianceConsole
|
|
175
168
|
|
176
169
|
def apply_initial_configuration
|
177
170
|
shared_buffers = run_as_evm_server ? SHARED_DB_SHARED_BUFFERS : DEDICATED_DB_SHARED_BUFFERS
|
178
|
-
with_pg_connection
|
179
|
-
conn.exec("ALTER SYSTEM SET ssl TO on") if ssl
|
180
|
-
conn.exec("ALTER SYSTEM SET shared_buffers TO #{shared_buffers}")
|
181
|
-
end
|
171
|
+
with_pg_connection { |conn| conn.exec("ALTER SYSTEM SET shared_buffers TO #{shared_buffers}") }
|
182
172
|
|
183
173
|
restart_postgres
|
184
174
|
end
|
175
|
+
|
176
|
+
def configure_ssl
|
177
|
+
cert_file = self.class.postgres_dir.join("server.crt").to_s
|
178
|
+
key_file = self.class.postgres_dir.join("server.key").to_s
|
179
|
+
AwesomeSpawn.run!("/usr/bin/generate_miq_server_cert.sh", :env => {"NEW_CERT_FILE" => cert_file, "NEW_KEY_FILE" => key_file})
|
180
|
+
|
181
|
+
FileUtils.chown("postgres", "postgres", cert_file)
|
182
|
+
FileUtils.chown("postgres", "postgres", key_file)
|
183
|
+
FileUtils.chmod(0644, cert_file)
|
184
|
+
FileUtils.chmod(0600, key_file)
|
185
|
+
end
|
185
186
|
end
|
186
187
|
end
|
187
188
|
end
|
@@ -41,10 +41,15 @@ module ApplianceConsole
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def create_partition_to_fill_disk
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
# Check if you need to create a GPT part table or a MSDOS one in base of
|
45
|
+
# max size of partition table
|
46
|
+
max_msdos_ptable_size = 2.terabyte
|
47
47
|
self.disk = LinuxAdmin::Disk.local.find { |d| d.path == disk.path }
|
48
|
+
|
49
|
+
partition_type = disk.size >= max_msdos_ptable_size ? 'gpt' : 'msdos'
|
50
|
+
disk.create_partition_table(partition_type)
|
51
|
+
|
52
|
+
AwesomeSpawn.run!("parted -s #{disk.path} mkpart primary 0% 100%")
|
48
53
|
@partition = disk.partitions.first
|
49
54
|
end
|
50
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manageiq-appliance_console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|