File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Removes an instance
3
+
4
+ set -euo pipefail
5
+ . /etc/jq-tarsnap-keygen.sh
6
+
7
+ INSTANCE=" $1 "
8
+
9
+ TARNSAP_KEYFILE=" $TARSNAP_KEYS_BASE_PATH /$INSTANCE .key"
10
+
11
+ echo " === Cleaning up $INSTANCE "
12
+
13
+ if [ -f " $TARNSAP_KEYFILE " ]; then
14
+ echo " Cleaning up old Tarsnap backups and key file"
15
+ if ! git -C " $TARSNAP_KEYS_BASE_PATH " diff-index --quiet HEAD --; then
16
+ echo " The private git directory has uncommitted changes, please fix that before running this script."
17
+ exit 1
18
+ fi
19
+
20
+ tarsnap --keyfile " $TARNSAP_KEYFILE " --nuke
21
+
22
+ git -C " $TARSNAP_KEYS_BASE_PATH " rm " $KEYFILE "
23
+ git -C " $TARSNAP_KEYS_BASE_PATH " commit -m " remove Tarsnap keys for $INSTANCE "
24
+ fi
25
+
26
+ echo " Removing from Puppet"
27
+
28
+ sudo puppet node deactivate " $INSTANCE "
29
+ sudo puppet node clean " $INSTANCE "
30
+
31
+ echo " === All done."
Original file line number Diff line number Diff line change 187
187
paths => [$private_repo_dir ],
188
188
}
189
189
190
+ # This also uses config from tarsnap::keymgmt.
191
+ file { '/usr/local/bin/jq-decom-instance' :
192
+ ensure => file ,
193
+ source => ' puppet:///modules/profile/puppet/server/jq-decom-instance.sh' ,
194
+ owner => ' root' ,
195
+ group => ' gitpuppet' ,
196
+ mode => ' 0550' ,
197
+ }
198
+
199
+
190
200
include profile::ssh::ca
191
201
192
202
# Expose SSH keys so users can verify them
You can’t perform that action at this time.
0 commit comments