Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
ccfe8c64
Verified
Commit
ccfe8c64
authored
Jan 20, 2022
by
Jelle van der Waa
🚧
Browse files
Implement gluebuddy role
parent
f4a91af7
Pipeline
#15049
failed with stage
in 37 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
roles/gluebuddy/files/gluebuddy.service
View file @
ccfe8c64
...
...
@@ -5,9 +5,11 @@ After=network-online.target
[Service]
Type
=
oneshot
ExecStart
=
/usr/local/bin/gluebuddy
StandardOutput
=
journal+console
EnvironmentFile
=
-/etc/conf.d/gluebuddy
ExecStart
=
/usr/local/bin/gluebuddy apply
DynamicUser
s
=
true
DynamicUser
=
true
NoNewPrivileges
=
yes
ProtectSystem
=
full
ProtectHome
=
true
...
...
roles/gluebuddy/files/gluebuddy.timer
View file @
ccfe8c64
...
...
@@ -2,7 +2,7 @@
Description=gluebuddy timer
[Timer]
OnUnitActiveSec=
1
0min
OnUnitActiveSec=
3
0min
OnBootSec=5min
RandomizedDelaySec=1min
...
...
roles/gluebuddy/files/gluebuddy_download.sh
0 → 100755
View file @
ccfe8c64
#!/bin/bash
set
-o
nounset
-o
errexit
-o
pipefail
NAME
=
gluebuddy
LATEST_GLUEBUDDY_FILE
=
/root/latest_release
readonly
PROJECT_ID
=
"archlinux%2Fgluebuddy"
RELEASES
=
"
$(
curl
--silent
--show-error
--fail
"https://gitlab.archlinux.org/api/v4/projects/
${
PROJECT_ID
}
/releases"
)
"
LATEST_RELEASE_TAG
=
"
$(
jq
-r
.[0].tag_name
<<<
"
${
RELEASES
}
"
)
"
if
[
-f
$LATEST_GLUEBUDDY_FILE
]
;
then
LATEST_RELEASE_DOWNLOAD
=
$(
cat
${
LATEST_GLUEBUDDY_FILE
}
)
if
[
"
$LATEST_RELEASE_TAG
"
=
"
$LATEST_RELEASE_DOWNLOAD
"
]
;
then
exit
0
fi
fi
readonly
TMPDIR
=
"
$(
mktemp
--directory
--tmpdir
=
"/var/tmp"
)
"
trap
"rm -rf
\"
${
TMPDIR
}
\"
"
EXIT
cd
"
${
TMPDIR
}
"
RELEASES
=
"
$(
curl
--silent
--show-error
--fail
"https://gitlab.archlinux.org/api/v4/projects/
${
PROJECT_ID
}
/releases/
$LATEST_RELEASE_TAG
"
)
"
ASSETS
=
$(
echo
$RELEASES
| jq .assets.links
)
LINKS
=
$(
echo
$ASSETS
| jq
-r
'.[].direct_asset_url'
)
links
=(
$LINKS
)
for
i
in
"
${
links
[@]
}
"
do
curl
-O
$i
done
sq verify
--signer-cert
<
(
sq wkd get anthraxx@archlinux.org
)
--detached
gluebuddy.sig gluebuddy
mv
${
NAME
}
/usr/local/bin/
${
NAME
}
chmod
+x /usr/local/bin/
${
NAME
}
echo
$LATEST_RELEASE_TAG
>
$LATEST_GLUEBUDDY_FILE
roles/gluebuddy/handlers/main.yml
0 → 100644
View file @
ccfe8c64
---
-
name
:
daemon reload
systemd
:
daemon-reload
:
true
roles/gluebuddy/tasks/main.yml
View file @
ccfe8c64
---
-
name
:
install sequoia
pacman
:
name=sequoia-sq state=present
-
name
:
receive valid signing keys
command
:
/usr/bin/gpg --keyserver keys.openpgp.org --recv "{{ item }}"
with_items
:
-
E240B57E2C4630BA768E2F26FC1B547C8D8172C8
register
:
gpg
changed_when
:
"
gpg.rc
==
0"
-
name
:
install systemd service/timer
copy
:
src={{ item }} dest="/etc/systemd/system/{{ item }}" owner=root group=root mode=0644
with_items
:
-
gluebuddy.service
-
gluebuddy.timer
notify
:
-
daemon reload
-
name
:
enable timer
systemd
:
name=gluebuddy.timer enabled=yes state=started
-
name
:
install conf file
template
:
src=gluebuddy.conf.j2 dest=/etc/conf.d/gluebuddy
-
name
:
install download script
copy
:
src=gluebuddy_download.sh dest=/usr/local/bin/gluebuddy_download.sh owner=root group=root mode=0755
-
name
:
download latest gluebuddy
command
:
/usr/local/bin/gluebuddy_download.sh
roles/gluebuddy/templates/gluebuddy.conf.j2
0 → 100644
View file @
ccfe8c64
GLUEBUDDY_GITLAB_TOKEN={{ vault_gitlab_gluebuddy_token }}
GLUEBUDDY_KEYCLOAK_USERNAME=gluebuddy
GLUEBUDDY_KEYCLOAK_PASSWORD={{ vault_keycloak_gluebuddy_openid_client_secret }}
GLUEBUDDY_KEYCLOAK_REALM=archlinux
GLUEBUDDY_KEYCLOAK_URL=https://accounts.archlinux.org
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment