chore(gitlab): upgrade package-based instance

This commit is contained in:
Michele Cereda
2024-08-22 19:51:50 +02:00
parent 185be94456
commit 4f95870c33
5 changed files with 26 additions and 1 deletions

View File

@@ -51,7 +51,8 @@ ansible-playbook 'path/to/playbook.yml' --syntax-check
# Ad-hoc commands.
ansible -i 'hosts.yml' -m 'ping' 'all'
ansible -i 'host-1,host-n,' 'hostRegex' -m 'ansible.builtin.shell' -a 'echo $TERM'
ansible -i 'localhost ansible_python_interpreter=venv/bin/python3,' -c 'local' -m 'ansible.builtin.copy' -a 'src=/tmp/src' -a 'dest=/tmp/dest' 'localhost'
ansible -i 'localhost ansible_python_interpreter=venv/bin/python3,' -c 'local' 'localhost' \
-m 'ansible.builtin.copy' -a 'src=/tmp/src' -a 'dest=/tmp/dest'
ansible-vault encrypt_string --name 'command_output' 'somethingNobodyShouldKnow'
ANSIBLE_VAULT_PASSWORD='ohSuchASecurePassword' ansible-vault encrypt --output 'ssh.key' '.ssh/id_rsa'

View File

@@ -116,6 +116,13 @@ aws kms get-key-policy --output 'text' --key-id '01234567-89ab-cdef-0123-456789a
aws ec2 describe-images --image-ids 'ami-01234567890abcdef'
aws ec2 describe-images --image-ids 'ami-01234567890abcdef' --query 'Images[].Description'
# Check state of snapshots.
aws ec2 describe-snapshots --snapshot-ids 'snap-0123456789abcdef0' \
--query 'Snapshots[].{"State": State,"Progress": Progress}' --output 'yaml'
# Wait for snapshots to finish.
aws ec2 wait snapshot-completed --snapshot-ids 'snap-0123456789abcdef0'
aws autoscaling describe-auto-scaling-groups
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names 'ProductionServers'
aws autoscaling start-instance-refresh --auto-scaling-group-name 'ProductionServers'

View File

@@ -33,3 +33,5 @@ gitlab-runner list -c '/etc/gitlab-runner/config.toml'
gitlab-runner verify -c '/etc/gitlab-runner/config.toml'
# Also delete runners that have been removed from the main instance
gitlab-runner verify … --delete
diff -y <(helm show values 'gitlab/gitlab-runner' --version '0.64.2') <(helm show values 'gitlab/gitlab-runner' --version '0.68.1')

View File

@@ -103,6 +103,14 @@ sudo gitlab-ctl backup-etc \
| head -n '1' \
| xargs -pI '{}' aws s3 cp '/etc/gitlab/config_backup/'{} 's3://backups/gitlab/'
# Put the instance in maintenance mode
sudo gitlab-rails runner '
::Gitlab::CurrentSettings.update!(maintenance_mode: true);
::Gitlab::CurrentSettings.update!(maintenance_mode_message: "New message");
'
# Take the instance out of maintenance mode
sudo gitlab-rails runner '::Gitlab::CurrentSettings.update!(maintenance_mode: false);'
# Package upgrade
sudo yum check-update
sudo yum info 'gitlab-ee' # informational