Sha256: 7252c991058e6f489a1daa20028be00815efa65191d424dd76571910e6b038b5

Contents?: true

Size: 1.1 KB

Versions: 43

Compression:

Stored size: 1.1 KB

Contents

module ManageIQ
module ApplianceConsole
  class DatabaseReplicationPrimary < DatabaseReplication
    include ManageIQ::ApplianceConsole::Logging

    REGISTER_CMD = 'repmgr primary register'.freeze

    def initialize
      self.node_number       = nil
      self.database_name     = "vmdb_production"
      self.database_user     = "root"
      self.database_password = nil
      self.primary_host      = LinuxAdmin::NetworkInterface.new(NETWORK_INTERFACE).address
    end

    def ask_questions
      clear_screen
      say("Establish Primary Replication Server\n")
      ask_for_unique_cluster_node_number
      ask_for_database_credentials
      return false if repmgr_configured? && !confirm_reconfiguration
      confirm
    end

    def confirm
      super
      agree("Apply this Replication Server Configuration? (Y/N): ")
    end

    def activate
      say("Configuring Primary Replication Server...")
      create_config_file(primary_host) &&
        run_repmgr_command(REGISTER_CMD) &&
        write_pgpass_file
    end
  end # class DatabaseReplicationPrimary < DatabaseReplication
end # module ApplianceConsole
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
manageiq-appliance_console-9.1.0 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-9.0.2 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-9.0.1 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-9.0.0 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-8.1.0 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.2.2 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.2.1 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.2.0 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-8.0.0 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.1.1 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.1.0 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.0.6 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.0.5 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.0.4 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.0.3 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.0.2 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-6.1.1 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.0.1 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-7.0.0 lib/manageiq/appliance_console/database_replication_primary.rb
manageiq-appliance_console-6.1.0 lib/manageiq/appliance_console/database_replication_primary.rb