There's a simple way in bolt to run commands from a file Show archive.org snapshot without caring about BASH escaping:
# /home/user/foo.sh
echo "$(hostname -f): $(uptime)"
echo "${USER}"
echo "${SERVERLIST}" | bolt command run @foo.sh --run-as root --targets -
Use
script run
Show archive.org snapshot
to run a ruby script:
#!/usr/bin/env ruby
# /home/user/bar.rb
puts 'Hello, world!'
echo "${SERVERLIST}" | bolt script run ./bar.rb --targets -
Related cards:
HowTo: let puppet agent run from different branch
This is not encouraged because this change is easily forgotten. We recommend using this only if you know what you are doing.
Should you be in need to run puppet
from a branch (called environment in puppet land) other than production
for a...
HowTo: switch to mise from asdf
Add apt source:
apt update -y && apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null
ech...
Useful PostgreSQL commands
on the bash (issued as postgres user)
Start/Stop/Restart PostgreSQL
pg_ctl -D $configdir start|stop|restart
Start/Stop/Restart the corresponding PostgreSQL using the given configuration directory. The configuration directory sh...
HowTo: Downgrade a Port on FreeBSD
Example
collectd5
in version 5.9.0
is broken and you upgraded it everywhere. But because it's FreeBSD it does not restart running services. After every old version is removed from /var/cache/pkg
you restarted collectd
and it does not s...
HowTo: Clone and refresh all repos in a GitLab Group
If the project you're working on has, say, 39 repositories and counting in GitLab and you need all the repos checked out for some reason, here's how to do it.
Checking out all repos
- Create a personal access token for GitLab that has the `A...
Use systemd-run as an alternative for screen
You might use screen
or tmux
to run a temporary command on a server which continues to run after the SSH session is closed.
Consider systemd-run
as alternative. It will turn every command in a systemd ser...
Prevent systemd from dropping IP-Addresses configured from other processes
Systemd's networkd will drop IP-Addresses configured by other processes like Keepalived's VRRP, when it is restarted. This may happens on updates.
To prevent this following settings are required in /run/systemd/network/10-netplan-eth0.network
...
When to use a function over a defined in Puppet
In Puppet, there are some differences between defined
and function
types when it comes to code encapsulation. In most cases, a defined type is best, but there are some situations where a function is more appropriate.
Use a defined type when:...
Fix "A client error (MalformedCertificate) occurred: Invalid Private Key." at AWS SSL Certificate upload
I'm creating certificate requests with this command:
openssl req -new -out www.example.com.csr -keyout www.example.com.key -newkey rsa:2048 -nodes
When I try to upload the certificate to AWS IAM I get this error:
$ aws iam upload-se...
SSH: Fix host key verification error after makandra servers were upgraded to a new Ubuntu version
Important
If your railscomplete-deployment uses the net-ssh-gem please ensure you use version 5.2.0 or newer to ensure you can deploy via Capistrano.
It's best to use the latest version, as there were multiple issues between 5.2.0 and 7.3....