Class: AmazonKamal::Cli::Main

Inherits:
Kamal::Cli::Base
  • Object
show all
Defined in:
lib/amazon_kamal/cli/main.rb

Instance Method Summary collapse

Instance Method Details

#bootstrapObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/amazon_kamal/cli/main.rb', line 5

def bootstrap
  say "Bootstrapping hosts...", :magenta

  with_lock do
    on(KAMAL.hosts) do |host|
      info("Bootstrapping #{host}")

      as "root" do
        # Update and install packages
        execute :dnf, "update -y"
        execute :dnf, "install -y docker htop git"

        # Add ssh user to docker group
        execute :usermod, "-a -G docker #{KAMAL.config.ssh.user}"

        # Start and enable docker service
        execute :systemctl, "enable --now docker"

        # Disable unnecessary services
        %w[
          amazon-ssm-agent
          gssproxy
          systemd-homed
          systemd-userdbd.socket
          systemd-userdbd
        ].each do |service|
          execute :systemctl, "disable --now #{service}"
        end
      end
    end
  end
end

#versionObject



39
40
41
# File 'lib/amazon_kamal/cli/main.rb', line 39

def version
  puts AmazonKamal::VERSION
end