opswalrus 1.0.27 → 1.0.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c63f73e2a4fddd7a8faa6a534357ca83e77e4fd218f5e3ffbc341c39f6d6bd7c
4
- data.tar.gz: 9f3c9ab5ddb6cc735dc114447ddab95963b2f3179de078b28f1b3c6ce0a40770
3
+ metadata.gz: 0ed3ebf666e1e12461a109ace60e4429008e5016fde3c4f0605e1b1f0e8c3a01
4
+ data.tar.gz: 88a949890ddb41d16d69e667e6440e4894a4d1ef369b0e4db301ce5f751c5570
5
5
  SHA512:
6
- metadata.gz: a08b0818cf1037f6e78cebf2a8ec037c10f33a715f64e60cd3f130825b087e80d187e33b33ee17e012f160473a825dfd9e8741fb9efb73267a1c205e36c3d68e
7
- data.tar.gz: 324de6cf287e61401e874c4fce266838dc1f1074d42c3b058be6b2f69977c53eb1c49ac4a49b291efc411d71465611f6ca740c30f36bcb62e12d82d680e66b87
6
+ metadata.gz: 8625724d93eea350e367d57468b8c4072a3f1e4946469afba2e950305b93d564e056afd368ee5af5c44483364ed41b3aa003bedeabb6e40281c0d65c6a10f8be
7
+ data.tar.gz: c75cfe115140ec4bcb09059e9f3ce96ea2b51bca4c60552221a53f4415c91b3da55ad1acef2f61fcf08cb93cfb20580390317862fa9f288f56a8787959189324
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.27)
4
+ opswalrus (1.0.28)
5
5
  amazing_print (~> 1.5)
6
6
  bcrypt_pbkdf (~> 1.1)
7
7
  citrus (~> 3.0)
@@ -1,19 +1,37 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # if brew is already installed, initialize this shell environment with brew
4
- if [ -x "$(command -v /home/linuxbrew/.linuxbrew/bin/brew)" ]; then
5
- eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
6
-
7
- # exit early if ruby already exists
8
- if [ -x "$(command -v $HOME/.rubies/ruby-3.2.2/bin/ruby)" ]; then
9
- echo 'Ruby is already installed.' >&2
10
-
11
- # make sure the latest opswalrus gem is installed
12
- # todo: figure out how to install this differently, so that test versions will work
13
- # gem install opswalrus
14
- $HOME/.rubies/ruby-3.2.2/bin/gem install opswalrus
15
-
16
- exit 0
3
+ export PATH="$HOME/.local/share/rtx/bin:$PATH" # this is key for activating rtx without running `eval "$($RTX activate bash)"`
4
+ RTX="$HOME/.local/share/rtx/bin/rtx"
5
+ rtx_init() { eval "$($RTX activate bash)"; }
6
+ # RTX_RUBY="$HOME/.local/share/rtx/bin/rtx x ruby -- ruby"
7
+ # RTX_GEM="$HOME/.local/share/rtx/bin/rtx x ruby -- gem"
8
+ RTX_RUBY="$HOME/.local/share/rtx/shims/ruby"
9
+ RTX_GEM="$HOME/.local/share/rtx/shims/gem"
10
+ RUBY_CMD=$RTX_RUBY
11
+ GEM_CMD=$RTX_GEM
12
+ # RUBY_CMD="ruby"
13
+ # GEM_CMD="gem"
14
+
15
+ if [ -x $RTX ]; then
16
+ # rtx_init;
17
+ # eval "$($RTX activate bash)"
18
+ # if brew is already installed, initialize this shell environment with brew
19
+ # if [ -x "$(command -v /home/linuxbrew/.linuxbrew/bin/brew)" ]; then
20
+ if $RUBY_CMD -e "major, minor, patch = RUBY_VERSION.split('.'); exit 1 unless major.to_i >= 3"; then
21
+ # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
22
+
23
+ # exit early if ruby already exists
24
+ # if [ -x "$(command -v $HOME/.rubies/ruby-3.2.2/bin/ruby)" ]; then
25
+ echo 'Ruby is already installed.'
26
+
27
+ # make sure the latest opswalrus gem is installed
28
+ # todo: figure out how to install this differently, so that test versions will work
29
+ # gem install opswalrus
30
+ $GEM_CMD install opswalrus
31
+ $RTX reshim
32
+
33
+ exit 0
34
+ # fi
17
35
  fi
18
36
  fi
19
37
 
@@ -42,7 +60,7 @@ elif echo $OS | grep -q 'fedora'; then
42
60
  sudo dnf groupinstall -y 'Development Tools'
43
61
  sudo dnf -yq install procps-ng curl file git
44
62
  elif echo $OS | grep -q 'arch'; then
45
- sudo pacman -Syu --noconfirm base-devel procps-ng curl file git
63
+ sudo pacman -Syu --noconfirm --needed base-devel procps-ng curl file git
46
64
  else
47
65
  echo "unsupported OS"
48
66
  exit 1
@@ -50,14 +68,15 @@ fi
50
68
 
51
69
 
52
70
  # install homebrew
53
- NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
71
+ # NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
54
72
 
55
73
  # initialize brew in shell session
56
- eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
74
+ # eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
75
+
76
+ # install gcc, age
77
+ # brew install gcc
78
+ # brew install age # https://github.com/FiloSottile/age
57
79
 
58
- # install gcc, ruby, age
59
- brew install gcc
60
- brew install age # https://github.com/FiloSottile/age
61
80
 
62
81
  ### install ruby
63
82
 
@@ -67,14 +86,76 @@ brew install age # https://github.com/FiloSottile/age
67
86
 
68
87
  # 2. via ruby-install
69
88
  # brew install bash grep wget curl md5sha1sum sha2 gnu-tar bzip2 xz patchutils gcc
70
- brew install ruby-install
71
- ruby-install --update
72
- ruby-install ruby 3.2.2
89
+ # brew install ruby-install
90
+ # ruby-install --update
91
+ # ruby-install ruby 3.2.2
73
92
 
74
93
  # 3. rvm
75
94
  # gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
76
95
  # \curl -sSL https://get.rvm.io | bash -s stable --autolibs=homebrew
77
96
  # rvm install 3.2.2
78
97
 
98
+ # 4. rtx (asdf clone)
99
+ if echo $OS | grep -q 'ubuntu'; then
100
+ # update package list
101
+ sudo apt update -qy
102
+
103
+ if [ -f /var/run/reboot-required ]; then
104
+ echo 'A system reboot is required!'
105
+ exit 1
106
+ fi
107
+
108
+ # install ruby dependencies
109
+ # see https://github.com/rbenv/ruby-build/wiki#suggested-build-environment
110
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq libgdbm6
111
+ if [ $? -ne 0 ]; then
112
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq libgdbm5
113
+ fi
114
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm-dev libdb-dev uuid-dev
115
+
116
+ # restart services that need it
117
+ sudo needrestart -q -r a
118
+ sudo needrestart -q -r a
119
+ sudo needrestart -q -r a
120
+ elif echo $OS | grep -q 'fedora'; then
121
+ # from https://github.com/rbenv/ruby-build/wiki#suggested-build-environment
122
+ sudo yum install -y gcc patch bzip2 openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
123
+ elif echo $OS | grep -q 'arch'; then
124
+ # from https://github.com/rbenv/ruby-build/wiki#suggested-build-environment
125
+ sudo pacman -Syu --noconfirm --needed base-devel rust libffi libyaml openssl zlib
126
+ else
127
+ echo "unsupported OS"
128
+ exit 1
129
+ fi
130
+ curl https://rtx.pub/install.sh | sh
131
+ # eval "$($HOME/.local/share/rtx/bin/rtx activate bash)"
132
+ $RTX use -g ruby@3.2
133
+ $RTX reshim
134
+
135
+
136
+ # 5. age
137
+ if echo $OS | grep -q 'ubuntu'; then
138
+ # update package list
139
+ sudo apt update -qy
140
+
141
+ if [ -f /var/run/reboot-required ]; then
142
+ echo 'A system reboot is required!'
143
+ exit 1
144
+ fi
145
+
146
+ sudo DEBIAN_FRONTEND=noninteractive apt install -yq age
147
+
148
+ # restart services that need it
149
+ sudo needrestart -q -r a
150
+ elif echo $OS | grep -q 'fedora'; then
151
+ sudo dnf -yq install age
152
+ elif echo $OS | grep -q 'arch'; then
153
+ sudo pacman -Syu --noconfirm --needed age
154
+ else
155
+ echo "unsupported OS"
156
+ exit 1
157
+ fi
158
+
79
159
  # install opswalrus gem
80
- $HOME/.rubies/ruby-3.2.2/bin/gem install opswalrus
160
+ $GEM_CMD install opswalrus
161
+ $RTX reshim
@@ -6,6 +6,9 @@ require_relative "invocation"
6
6
 
7
7
  module OpsWalrus
8
8
 
9
+ OPS_GEM="$HOME/.local/share/rtx/shims/gem"
10
+ OPS_CMD="$HOME/.local/share/rtx/shims/ops"
11
+
9
12
  # the subclasses of HostProxy will define methods that handle method dispatch via HostProxyOpsFileInvocationBuilder objects
10
13
  class HostProxy
11
14
 
@@ -188,7 +191,8 @@ module OpsWalrus
188
191
  end
189
192
 
190
193
  # cmd = "OPSWALRUS_LOCAL_HOSTNAME='#{local_hostname_for_remote_host}'; /home/linuxbrew/.linuxbrew/bin/gem exec --conservative -g opswalrus ops"
191
- cmd = "OPSWALRUS_LOCAL_HOSTNAME='#{local_hostname_for_remote_host}'; $HOME/.rubies/ruby-3.2.2/bin/gem exec --conservative -g opswalrus ops"
194
+ # cmd = "OPS_GEM=\"#{OPS_GEM}\" OPSWALRUS_LOCAL_HOSTNAME='#{local_hostname_for_remote_host}'; $OPS_GEM exec --conservative -g opswalrus ops"
195
+ cmd = "OPSWALRUS_LOCAL_HOSTNAME='#{local_hostname_for_remote_host}'; #{OPS_CMD}"
192
196
  cmd << " -v" if verbose
193
197
  cmd << " #{ops_command.to_s}"
194
198
  cmd << " #{ops_command_options.to_s}" if ops_command_options
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.27"
2
+ VERSION = "1.0.28"
3
3
  end
@@ -29,6 +29,9 @@ Vagrant.configure("2") do |config|
29
29
  # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
30
30
  # documentation for more information about their specific syntax and use.
31
31
  config.vm.provision "shell", inline: <<-SHELL
32
+ echo "tmpfs /tmp tmpfs rw,nodev,nosuid,size=5G 0 0" | sudo tee -a /etc/fstab
33
+
34
+ # this helps to address the issue where new builds of fedora do not honor the vagrant network config settings
32
35
  sudo dnf install -yq NetworkManager-initscripts-ifcfg-rh
33
36
 
34
37
  # this migrates the old network management config to the new style
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opswalrus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.27
4
+ version: 1.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ellis