From b4189939f8a33b75f0e9dead93555485c748dba2 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 31 Mar 2024 09:45:11 +0900 Subject: [PATCH 1/7] Update `Consul` certificates. --- .../consul.d/certs/consul-agent-ca-key.pem | 30 +++--------- .../etc/consul.d/certs/consul-agent-ca.pem | 48 +++++++++---------- .../certs/dc1-server-consul-1-key.pem | 12 ++--- .../consul.d/certs/dc1-server-consul-1.pem | 44 ++++++++--------- 4 files changed, 58 insertions(+), 76 deletions(-) diff --git a/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca-key.pem b/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca-key.pem index 144498d..7cfe5c1 100644 --- a/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca-key.pem +++ b/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca-key.pem @@ -1,24 +1,6 @@ -md5:4f683f562e56d8663a72584dfa67b247:salt:116-0-67-185-96-189-235-121:aes-256-cfb:/pbbA5VABbbCOrdOi/C+lfBXQ2v5kTXj7eid4Sh3CaL4fokVqN0txFlLJiqZ -Hstgm8GIFK1+33JHrOdbPCszRjyTW18P0pDmZbXilh0kg5otpYrQ67f5E976 -mJz9Mr9MeBZ7At6H4nnWAAaSQu2MDgBgrkVLL87NYARn0t0qOz4PAU3mN8Ah -e/fT1Awr8s4m/cupKAX6q0vZ4w1mfS+oY9tWeDDppvpr9AuYWLofvaB5axIu -x54YETl7vvpu+rvkLs9iuzw1Xvws/ztUxS1QBMAlIxBd1ICHMTd0+7hZf/tU -bH7gNqMDaTDAZzruDOisS7H6x47G9rOkGeuS/1RsEB8u3qV2IDXEgwfETfH4 -f1TUq1s3oaNGGTSnUBxjx0iUMZOk6+vy1xX4oa3bq4wa6PVQONdhrbqx4hvQ -Y69Q36Q4gpTtI58YDx7U+Nc8TEnL6OCRewGOsBjUv5gjMZbn9wMUzFEvNyr3 -4gquHT9OARvvmqybm7L8Af7proWAo5Mxy+rB3o0eAjSZ5ND7hQtCMKlMqtkc -Z5xBemLKXTBrqt5wZ+MACL51UJX0ngLAESW8vpy19y+kMOkM+kuqT4sqjsFw -sHn4mOsg4PCio61zs7aylWLFWZZBfKcD/wuHseL22U3cabyRaUabotSgZrAf -uqOJWVUihNSJ8ak6t/6Lrc8ilyLzULvwdiT+ZjavGXi1c6Ext/VmQIUHIjUy -dd+ScLvgpKJVztW2sIpOXbUzYDgjMsYR4H6XJw6OFmneuL9z/0qaUs011y2z -5kaakT+by7v+czTj0lflTdz55RLPNViYY3rZZiCn2X/UjXhRXFBuVOY4Rm7f -hB8MmTyGPf9fQk0aKWEi6QTA+Lt3/4ak9rY5K3I+g1f66Hn8zZmJU+fETXuH -RhbXgrhHdH/i44rkDVkJL4obf9JhsBWYAcMhQN/5z91gf45V0J8VWF46vGRR -y4N04NifLXuZG7rA3Hw3xY9EyBOAPHII45qSzQM94Exo/Xik/QLfChnaLPQO -XcUx32w8f1g0Vm+K4I4g3BEGmztLnoVodW9qqF//4/HmJqHry2znLhI0EAtN -CUA270z6tGzuMUgZo7rJX06Pn76HRaBkyWMBcQzN72JaIbZvrsOJJHhVMLmu -PBjXyJmF0tNwFtMEwGYJ2T4OfGpCCD+NPS5nEQ6bZ0sX3/qJwhGD8Vz3U4P6 -3fhRlnjM2KJFQ5CCl95lpTGwsbeP6NNaoCAmLZXcSMDiL6YQDy/rtN3Q4LfO -pfgg3hf5a041qSo5FOY+7vjyc9ndYisLxnoAtB90cX8ORnKKZBugqlvarYMR -x4tJ6S2h2177eRwIcm7uHCd96ne/g/s0ScEoqHZg0vXs645F+ovi2ymsKxxN -CrRkuxP1P8bhK3Bn1ylK4aejktOzy4dcdEmUCwJlPElnJbuQtnjv \ No newline at end of file +md5:1800a974606c4f985f68b8f1f185a72a:salt:50-245-202-18-58-10-23-17:aes-256-cfb:NPwd14i34ZgH7Fn/9uzoutX9OIU1dbmmRnppizicrn3RXvoSGi/8vFlpWrk9 +uCY1X59EEgcXdkebb0uY4s16sYyuoJ0Ifs6xN8PJV/FPmnd7KtongsQJoxUZ +RAMPtl/2QVPUOYfLOb8PSNlAZhIKMmwR6jaBQK2shxzWzWL59Q9xQQr3E0NG +wHgNoqFzIPzjGKzB4ol5IsM9Xno16WiG7dsOBUKzjp+Mbl3SvSkx6qbbq+Hq +hptvWVDlhSts2FrV00+7d6Fv2c3aA9/0RXHqE6ujRRHO6CGHtxwzmD77ctLa +T9U= \ No newline at end of file diff --git a/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca.pem b/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca.pem index 7e561d2..42fec58 100644 --- a/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca.pem +++ b/cookbooks/consul/files/etc/consul.d/certs/consul-agent-ca.pem @@ -1,24 +1,24 @@ -md5:4f683f562e56d8663a72584dfa67b247:salt:104-7-237-106-15-219-15-45:aes-256-cfb:/IYVG1CC7S1/KK5iEO1BUrlqH8/OddDGctvAzUZ8IVolFnt5C5e3evwjYjJ5 -F3sh4uVIMwEq2QSWjn+ZX54zaol/tAGLV18lb9fxIuPNL+bZqoUsM7w4nGL4 -s6uNSvbzku+YJ0iDNI38i2h0WpR/3PYfL0cnLsgt/I+cB7nzfY1HCwaUXj7V -52IwwMtpIKxXVPyAF974Auwx7ar43IGDGXyYumgIeueJ7wP1dKi8NEb777Bz -T6TMnauGWVJagMn7FQxXyNojui7qjzqJjnIZaE18ztObA9co9dgfuSE4TOhr -nuZ0hvZ3bEIYt0B8QTBEoUR+mRoKCeUvc15kGU4aZNesg4GKa8lPMonQnrj2 -f6sOfru4UzHrkJNIHcgeFT+vSYo0s5co27y1oqtijWpnZ0oUd8brBP9KI+rB -sdWaXltx+sEJKWULZRspFRGWvJl/QPTTRMJtSKBKfa4xo66LkZatVGgr5+HP -1a6S/m6QW0d9J/Bcd9LYO2RRZSDYYC3DJgXNwPhd9EQ2m7nLl6fZbt3uFzYa -rFdgmlPwugrvm4IZOjAT5msf6BC3BLxbYR2TvM+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ygxwprt6kLsSaBa2Mo2mr4w +jJ3TPFuXdtChFQgdTs2Df4jXgmlo8znO3WdzJVv3085lHgrjKiCopCrM2kNC +BabLMzKFkzfGgSCUM4wtsd1BIUYLzMEDZCHeeqaLTYLUqMCcefOM6Yz+MkEI +AKblIbhVgKsv94ShUieTELKFG2Szynpz25AG7nRCwumqZ8TyH1jC4kP5uSEj +KK/KLziLVpFK2Xco0qNHbaR8HN8QhYSczpJuU5Li7OLhzf5ewEAWyk30rQ== \ No newline at end of file diff --git a/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1-key.pem b/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1-key.pem index 3311937..f0266b2 100644 --- a/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1-key.pem +++ b/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1-key.pem @@ -1,6 +1,6 @@ -md5:3fe62feb81f46bc71cf0e43936d98efa:salt:5-77-73-67-58-107-161-252:aes-256-cfb:6B67412gDFtS5lssg5QCREm5vrWJA2pfLbnqySZHkqEp9xd2rG4S+vak3DAk -9ruQRqOZOs5vmzysY6AONeAK0ghGId9olkPDUqxuj0xZ466Yt4BDGnmTl2rU -WoKONoX+GZz7zmVxqYfykHCgkHb0bfV7HRWJKiVBTvxlDQtceoTScu2qrlRj -aRmsaKvpR2LvNeh+D9tVqmD3+T4924jjO1HqkyAXEu0RENRvwFJIb3Vd9WwC -Mp/49miaRSdZ/OkXyu8hG00bqt40Edn9wJSWDHDw5XYYVoBlYYHCfzAuQw3K -fL+BxPM= \ No newline at end of file +md5:aecc02a5fe8756767577a6b933002798:salt:187-147-187-195-245-156-175-53:aes-256-cfb:AeERgQvTQUNWf61WqyDVkS7r4JYGMx5Vzk8ZaSUZnsk7FaD6Bec/LIklnB9D +txATqD86TfG9leSC3cOqWKTuvb3N7IVV6Kvo3MmhwmR96Sia4JBwJBJSyOXO +03eEmwcMMkE5VE5pRhpcvYox2xOP8iOpYXNPNiFYNZQdXqjnvMwpXuTv44wu +gBUgdpjbYuHCRYmL52/CJ1n34ZrAdwmzac5jpIKtv6eODmP8gX946vs1+hwP +qlyOJfdQP1g+Zo7gAg6GskBjm1tU/nf0jV+9u/o/UU+b7yrqbEOIgLGSf+qk +YQA= \ No newline at end of file diff --git a/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1.pem b/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1.pem index dec7317..c88c9d7 100644 --- a/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1.pem +++ b/cookbooks/consul/files/etc/consul.d/certs/dc1-server-consul-1.pem @@ -1,22 +1,22 @@ -md5:3a2252bcb411d02014a3e1a14efc1cac:salt:4-79-66-221-55-44-210-100:aes-256-cfb:FoeqpBC4Wrwrmu/9a+Jo9ejvJMoLuqfxXLAi4sJHJowcallU4XWZzDWnJHqj -a8gHLk1bx6ysJp/rTD7oEBp3WEbg3wGu2v+ywl+DrHbArS6lR0PQ0U6mu/EX -RiqTPiv7HmvExIBVeMCUamkS7HnKLKdf/X2Mo2z/yWca0gORNeElQoCs/UaC -AXnlgQzd6sYAzxYIYqOQSzz42f1CqA2yIy38R4j8O/VbQ7MBLuDa6b0nYsjp -/gMH7KHdeP+5ZeE+JueJjbgChkmuq6soBfWuxuij1uJFhrnKsf9kX7n0uGOh -IHHBMJbm+vORcha/En2KviNwmxQWF3RF+Ba0NazkiEdxvpaozYutSdwn6r2I -XlGBg6OTTTXOZVXjB/gFZjBBXQruLw2vHKxEGtR3iNYJbfEA90wbaB8EP4bZ -8E2ktbJ/HWD6V9ruQ3wRgh2YQ6WTjEi/a54uZJgWbxDsYIVdHrrwpQrPtZlg -1FdpE2dzE8b1Lr+obub6U0Rn2Eo2Pc17leEsGmMxGyyJecCJxW49U4fCgsAM -rJC3ky8/38sQh7W5NJdRhUkYW3sSWe8ZcTCFjONMea65DI6bt/pbj+sw+4a1 -NtJDOWb7yRSI4yqTNYntGZMygDW7PPLAh95lGkHWJgHXOCQcMK4Oyct7ArRl -nwt2p5JvPEeJlgj0pbqqXMc3EenOVY2I2PNOb83YThXPEc5HYhciRee7W2TH -VIacv30zV5iC/LA9ddHSe0SG00GujYdMLGDCqb4NBn5UUmEVKDQ+YRUcwolS -J0triJjN7bDMDZihBrDkR/H+IhEzYE0CwHxwDO0jVzw6JPv72GN5dpabgoCC -9Ul+3gM3k3uOUII6VZe85AHew7Ih5a7DJL3O9jlgCNqIla+LWDFsRsO+nXKK -0X0l6mBivT1J0xs4WAFWJDMZzoXDhvrQgxPMeYiRVb42P9XgqvBaRzASa3I0 -VqP8bmgauBddgOPMf36R2U2KlomyDcS1qwncrtRX8Ix2jO7Ei+SBiO7g6jV3 -34tU9eeUpdY7Q2lc88oGJQ8lGRHppMJEm45U8XBzZBMn6kTtoEUTMSu3tz7s -sslPifdBxp9k031DtpI0FRvgf9EDU9CSL3PWuIRkRyllbllpfuPABxe2n41e -2X1q9yyMe88YByWy8P44dHT5ObsZWjtLspKFXme4jCRAwIljTBdeuBHPa5rX -6awSzdPfwbrBeUNBcHBKxmGAODmkiv4akakYRl7kipcMIY1mx948Rc0XCwvx -XGBNhzyQZogKZZUpTqANvqOf7e+RJpHJ \ No newline at end of file +md5:1d63f016fe95244d207d92b2182cb1ed:salt:27-175-103-24-138-253-66-49:aes-256-cfb:qTFgf0jV/KOGBDJn6PBkpznIJha9dp2UlRllDe+UXIRiOBhSPy8QpXFWYifG +wwktK3D8pKEItagD1gHbg1kBCTfTD3MvBZaGSnWaUjwgO/OcgIssFo4vNhJo +kv5f0dm8TzWtA1YyMoLpA11ym56yGMYolHxaCYC/UNFsl1MTboMfRXq/CZMZ +UJoTMnD2oJrT+4LTRvBz9dKJDLzNe1hJTIjIzfPCq4OoxT6zei10aJUevcob +vfirO21K+XAUqA2b9rapCElRerOiAHkD/2KjQyuosjDvhESJBGlUxWArOWq/ +tBoEAiKricxtCcWSiFFwni4hHb8VbHs7U0ST3v1lyBMjeZhPpRrmNtlxQbEd +swN2Jsa21Wk1x530e2pB50BJFCUf5e+50qjyqzMyuR2YlgY6k2BvbkoXa0jn +nPYnwPV8784fg4GfSqvxTgpsh2Q4GGV+o6hFwRJhTrh2wN7tFbTmh3MtyAh0 +uiR9vKKZVhhpGG4qDJYBq8zcQRjJc23MZWxdcdxnbPbAmqtCdWxj5uUPdUnm +kIottemifNnjW4oFFuPZErcfkBNk0rMrzsUypIbWQDM/AuKMRF8Eo6OO9n6E +e5LXbr/lDoT1o5EG9lG1f2cxbJBt1BOnG033/5jXw0wrDVy49SyiQqIWUAyg +iGLCIBQVQM3ZPkpUFIP5u/MEBrVK20Bt+pglWM1ZjXMWsL/D1/h6g+nGpKDM +PkIyFZe+CfT4UKox3AYOT9MGh7CbbkGEY4ffrq3TVNMaVwckPKMAlpzfKgm5 +wreBQlDkdNig++cif0DwsVjUDdAyPE0nbaKH2+6HxMJzKh0BJjvrJp0LFDCo +GFGxHnjo1vS1kRBFXW3fyco7nQzjpEBNb9USn9JiJsib3a0WfKXxsMUXTm++ +jbUmzI0D4bKhKMLzCdcLE3cmWsPtqSwJSO/3Ibo4Ewxsrcti1exQaTewTXYK +LDFkY1byar3R/fFKHgl3F+Tjn1uROBfXsHOcxOWCd7UqcD0+BAp/HdQDeYIq +O0Y4kQeWuRZW9ALCY8I1D/3Nzs2K6etc4bvan/m6lbB+WJbzk4CrAcr7Bebu +GsSd7s6W7NsTCGElpmvExa9/EhSdccXz0HeJKeE/xiYo+3X8RtdpOwauuodt +ciOLMw5b9nBoLCjxfZY8hr+7BQOw8/UFnfmEZMUpPTwJgBurs2NfdTsagzbz +nx18+nfgRvbRTRvjZrcfrSTKSzJsnujcdBzApMdTd9+fopZNrs3MXFSLGBQc +FHP3qYlBLAF7gZLrCPdfGkOrLA== \ No newline at end of file -- 2.40.1 From 63935ec789208c792406c5c58f9d31ccda918441 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 31 Mar 2024 09:45:29 +0900 Subject: [PATCH 2/7] Deploy `/etc/consul.d/server.hcl` only when the consul is server. --- cookbooks/consul/setup.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cookbooks/consul/setup.rb b/cookbooks/consul/setup.rb index 758ed13..70042ee 100644 --- a/cookbooks/consul/setup.rb +++ b/cookbooks/consul/setup.rb @@ -71,14 +71,16 @@ template '/etc/consul.d/consul.hcl' do end # Deploy server specific config -template '/etc/consul.d/server.hcl' do - owner 'consul' - group 'consul' - mode '644' +if node['consul']['manager'] + template '/etc/consul.d/server.hcl' do + owner 'consul' + group 'consul' + mode '644' - variables(server_token: node['consul']['server_token']) + variables(server_token: node['consul']['server_token']) - notifies :restart, 'service[consul]' + notifies :restart, 'service[consul]' + end end %w( 01-bootstrap.sh 02-policy.sh ).each do |sh| -- 2.40.1 From 5eaf0d9143c39023ed8f941442c308c6cef09cda Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 18 Feb 2024 11:17:11 +0900 Subject: [PATCH 3/7] Install `mise`. --- cookbooks/kazu634/default.rb | 2 ++ .../files/etc/apt/sources.list.d/mise.list | 1 + cookbooks/kazu634/mise.rb | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list create mode 100644 cookbooks/kazu634/mise.rb diff --git a/cookbooks/kazu634/default.rb b/cookbooks/kazu634/default.rb index 13ebf98..4021165 100644 --- a/cookbooks/kazu634/default.rb +++ b/cookbooks/kazu634/default.rb @@ -5,3 +5,5 @@ include_recipe './ssh.rb' include_recipe './vim.rb' include_recipe './mc.rb' + +include_recipe './mise.rb' diff --git a/cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list b/cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list new file mode 100644 index 0000000..1d0b734 --- /dev/null +++ b/cookbooks/kazu634/files/etc/apt/sources.list.d/mise.list @@ -0,0 +1 @@ +deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main diff --git a/cookbooks/kazu634/mise.rb b/cookbooks/kazu634/mise.rb new file mode 100644 index 0000000..469ab03 --- /dev/null +++ b/cookbooks/kazu634/mise.rb @@ -0,0 +1,27 @@ +directory '/etc/apt/keyrings/' do + owner 'root' + group 'root' + mode '0755' +end + +execute 'wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | tee /etc/apt/keyrings/mise-archive-keyring.gpg' do + not_if 'test -f /etc/apt/keyrings/mise-archive-keyring.gpg' +end + +remote_file '/etc/apt/sources.list.d/mise.list' do + owner 'root' + group 'root' + mode '0644' +end + +execute 'apt update' do + not_if 'which mise' +end + +package 'mise' + + +# For Ruby installation: +%w( git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev ).each do |p| + package p +end -- 2.40.1 From db464d8d51c65a756b1082314a0fa68df4afbaf6 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 31 Mar 2024 09:52:24 +0900 Subject: [PATCH 4/7] Add `.mise.toml`. --- .mise.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .mise.toml diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..c8650bc --- /dev/null +++ b/.mise.toml @@ -0,0 +1,2 @@ +[tools] +ruby = "3.2.2" -- 2.40.1 From 8be3828b0f2466ca781b2733eb2ce6ae85e826cf Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 31 Mar 2024 17:23:40 +0900 Subject: [PATCH 5/7] For `vault agent` to function properly, add `HOME` environment variable. --- cookbooks/consul/files/etc/default/vault-agent-consul-jwt | 1 + 1 file changed, 1 insertion(+) diff --git a/cookbooks/consul/files/etc/default/vault-agent-consul-jwt b/cookbooks/consul/files/etc/default/vault-agent-consul-jwt index 2fc3ddc..6e8b836 100644 --- a/cookbooks/consul/files/etc/default/vault-agent-consul-jwt +++ b/cookbooks/consul/files/etc/default/vault-agent-consul-jwt @@ -1 +1,2 @@ VAULT_ADDR="http://192.168.10.142:8200" +HOME="/tmp" -- 2.40.1 From 7920ed2423efc991d9e7b013928f3f5c08121fa3 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 31 Mar 2024 20:07:39 +0900 Subject: [PATCH 6/7] Update sources.list and GPG key for Vector. --- .../files/etc/apt/sources.list.d/vector.list | 1 + cookbooks/vector/install.rb | 21 +++++++------------ .../etc/apt/sources.list.d/timber-vector.list | 3 --- 3 files changed, 8 insertions(+), 17 deletions(-) create mode 100644 cookbooks/vector/files/etc/apt/sources.list.d/vector.list delete mode 100644 cookbooks/vector/templates/etc/apt/sources.list.d/timber-vector.list diff --git a/cookbooks/vector/files/etc/apt/sources.list.d/vector.list b/cookbooks/vector/files/etc/apt/sources.list.d/vector.list new file mode 100644 index 0000000..5170350 --- /dev/null +++ b/cookbooks/vector/files/etc/apt/sources.list.d/vector.list @@ -0,0 +1 @@ +deb [signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg] https://apt.vector.dev/ stable vector-0 diff --git a/cookbooks/vector/install.rb b/cookbooks/vector/install.rb index 8d1b39f..2b6b06f 100644 --- a/cookbooks/vector/install.rb +++ b/cookbooks/vector/install.rb @@ -1,20 +1,13 @@ -KEY='https://repositories.timber.io/public/vector/gpg.3543DB2D0A2BC4B8.key' - -execute "wget -O /tmp/vector.key #{KEY}" do - not_if 'apt-key list | grep "1E46 C153"' +%w("DATADOG_APT_KEY_CURRENT.public" "DATADOG_APT_KEY_C0962C7D.public" "DATADOG_APT_KEY_F14F620E.public").each do |key| + execute "wget -O /tmp/#{key} https://keys.datadoghq.com/#{key}" + execute "cat /tmp/#{key} | gpg --import --batch --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg" end -execute 'apt-key add /tmp/vector.key' do - not_if 'apt-key list | grep "1E46 C153"' -end - -# Retrieve the Ubuntu code: -DIST = run_command('lsb_release -cs').stdout.chomp - # Deploy the `apt` sources: -template '/etc/apt/sources.list.d/timber-vector.list' do - action :create - variables(distribution: DIST) +remote_file '/etc/apt/sources.list.d/vector.list' do + owner 'root' + group 'root' + mode '0644' end execute 'apt update' do diff --git a/cookbooks/vector/templates/etc/apt/sources.list.d/timber-vector.list b/cookbooks/vector/templates/etc/apt/sources.list.d/timber-vector.list deleted file mode 100644 index a692b57..0000000 --- a/cookbooks/vector/templates/etc/apt/sources.list.d/timber-vector.list +++ /dev/null @@ -1,3 +0,0 @@ -deb https://repositories.timber.io/public/vector/deb/ubuntu <%= @distribution %> main - -deb-src https://repositories.timber.io/public/vector/deb/ubuntu <%= @distribution %> main -- 2.40.1 From c52b9cac6a2f90230d19837f410cea25734ba67a Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 31 Mar 2024 20:09:40 +0900 Subject: [PATCH 7/7] Update comment of `ubuntu.rake`. --- tasks/ubuntu.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/ubuntu.rake b/tasks/ubuntu.rake index 0a2cea7..657ab29 100755 --- a/tasks/ubuntu.rake +++ b/tasks/ubuntu.rake @@ -1,6 +1,6 @@ #!/usr/bin/env rake -desc 'Invoke itamae command for the first time' +desc 'Invoke itamae command for AWS Environment for the first time' task :ubuntu do node = `ls -1 nodes/*.json | xargs -I % basename % .json | fzf` node.chomp! -- 2.40.1