Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pktpls committed Dec 8, 2024
1 parent be3bcae commit 83681f1
Show file tree
Hide file tree
Showing 14 changed files with 217 additions and 18 deletions.
64 changes: 64 additions & 0 deletions inventory/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,67 @@ buildbot_workers:
37306633646162323961313262376566636566313466623533316461303163643735383931386561
3461376637393032300a363835396131663639303965653339376466393063616536313338336436
35343333393832623935653763633237353263363462383765363862353034613161
- name: hway-buildbot1
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
39323366363438373736373737373661376166313465613133353837383363373264636564376464
3661366137383530356231613033643764663830656232660a643436323665353037626566353034
31323734623763336335353331316637316237633037613034353238343963326638323832376530
3165363138613062630a366336346163343836666432636664653736666566383834393164356137
34666363393430323133383131336566346636653764643161633763653039336236
- name: hway-buildbot2
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
30633031663635303836666638623064643636343031633535366531383838303535306337346332
6166363031303166313462346330616261386135623661630a376165343961303036633133633137
31306664663931333631633730623734656433663161393762353137663137303334303639343339
6462623033343362610a363232333738386135326262316235646133656331323839313334613131
63356332656538646237363236373537396264633434623238666465373139663630
- name: hway-buildbot3
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
35363530636562343965333462653839643938303230663738363136643561616438303839346532
6538316563346133363238383665346361366634343336390a323637383932323334623164623938
30646231343938623162333966303461376263383033363534633739626665386136663932353562
3766646139366134640a343261353166616137613131633532636230653134393166656434616465
65363036626137373065663436313836636439353565303738646664663265653837
- name: hway-buildbot4
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
33353438353865346432366536363864313831346364386339366666613731396638643266373462
6463376663663239323465383438313339656437663632380a643661363966623466376539373635
65366530616432383732363065336239663361326139663831666231343738636663353837633130
3333376662353837660a336331646534326666626566623061316166323638653062633335376133
66373237616465633031396137393138313863616534323536356135643634613734
- name: hway-buildbot5
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
65666162313836323861353036656431613131343861353230363165643464623636386436326238
6636316161363335366264613366656262653932376437370a346231656338643131376532633464
36646565353562356431633265396538396338313065323263626431363734373637356565343334
3336393764346562370a653036626231636633303362613164656637336535386461343861363232
33656635323830616533656363333861363732356663383965343937316163643239
- name: hway-buildbot6
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
64303765373534633263613661316661383338653165666235366230353235303534323334616437
3261613765663831666163323563633233393933663561320a653663646366393237366331393061
36613933623134353039633731336533303836363530356262633534656264393865316638383031
3630353430313131340a343966313836343363626435396565376432343739643230616662666431
62356232383030346234376466356430613466346436363334396230653365336566
- name: hway-buildbot7
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
63303334346132633736653136313965356131656237366566626664656233383738643033343232
3932376136316333663139633334653966383661386562640a643537663339326165303534636537
62356363666434373536656662313965346139343136306638643662633034633536383631663662
6539326163313534630a303266653934326339653763353532663165613931373336613363663530
39336133303264396331336539353163333861326664316361663536626266396339
- name: hway-buildbot8
passwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
32613933316635323132613836336234346638313836356666643234663536656466666234356234
3735316539306361663561396539373362643162396235360a623030303565313338333636353466
38373466633733383761666166613032646636633165306238626330656533316139333466373162
6566393534363935340a396630636230653234396662613665356431616132383565333661383766
31383439336537396235616333376361623934376264303637373866356665313161
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-1/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot1
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
39323366363438373736373737373661376166313465613133353837383363373264636564376464
3661366137383530356231613033643764663830656232660a643436323665353037626566353034
31323734623763336335353331316637316237633037613034353238343963326638323832376530
3165363138613062630a366336346163343836666432636664653736666566383834393164356137
34666363393430323133383131336566346636653764643161633763653039336236
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot1/
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-2/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot2
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
30633031663635303836666638623064643636343031633535366531383838303535306337346332
6166363031303166313462346330616261386135623661630a376165343961303036633133633137
31306664663931333631633730623734656433663161393762353137663137303334303639343339
6462623033343362610a363232333738386135326262316235646133656331323839313334613131
63356332656538646237363236373537396264633434623238666465373139663630
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot2/
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-3/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot3
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
35363530636562343965333462653839643938303230663738363136643561616438303839346532
6538316563346133363238383665346361366634343336390a323637383932323334623164623938
30646231343938623162333966303461376263383033363534633739626665386136663932353562
3766646139366134640a343261353166616137613131633532636230653134393166656434616465
65363036626137373065663436313836636439353565303738646664663265653837
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot3/
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-4/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot4
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
33353438353865346432366536363864313831346364386339366666613731396638643266373462
6463376663663239323465383438313339656437663632380a643661363966623466376539373635
65366530616432383732363065336239663361326139663831666231343738636663353837633130
3333376662353837660a336331646534326666626566623061316166323638653062633335376133
66373237616465633031396137393138313863616534323536356135643634613734
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot4/
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-5/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot5
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
65666162313836323861353036656431613131343861353230363165643464623636386436326238
6636316161363335366264613366656262653932376437370a346231656338643131376532633464
36646565353562356431633265396538396338313065323263626431363734373637356565343334
3336393764346562370a653036626231636633303362613164656637336535386461343861363232
33656635323830616533656363333861363732356663383965343937316163643239
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot5/
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-6/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot6
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
64303765373534633263613661316661383338653165666235366230353235303534323334616437
3261613765663831666163323563633233393933663561320a653663646366393237366331393061
36613933623134353039633731336533303836363530356262633534656264393865316638383031
3630353430313131340a343966313836343363626435396565376432343739643230616662666431
62356232383030346234376466356430613466346436363334396230653365336566
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot6/
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-7/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot7
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
63303334346132633736653136313965356131656237366566626664656233383738643033343232
3932376136316333663139633334653966383661386562640a643537663339326165303534636537
62356363666434373536656662313965346139343136306638643662633034633536383631663662
6539326163313534630a303266653934326339653763353532663165613931373336613363663530
39336133303264396331336539353163333861326664316361663536626266396339
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot7/
14 changes: 14 additions & 0 deletions inventory/host_vars/buildbot-worker-hway-8/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
bbworker_name: hway-buildbot8
bbworker_pwd: !vault |
$ANSIBLE_VAULT;1.1;AES256
32613933316635323132613836336234346638313836356666643234663536656466666234356234
3735316539306361663561396539373362643162396235360a623030303565313338333636353466
38373466633733383761666166613032646636633165306238626330656533316139333466373162
6566393534363935340a396630636230653234396662613665356431616132383565333661383766
31383439336537396235616333376361623934376264303637373866356665313161
bbworker_contact: Packet Please <[email protected]>
bbworker_info: Ryzen 5700G, 2 cores, 2GB RAM

bbworker_dir: hway-buildbot8/
8 changes: 8 additions & 0 deletions inventory/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ buildbot-worker-04 ansible_host=85.215.162.88
buildbot-worker-akira ansible_host=192.168.16.7 # only from within martins home...
buildbot-worker-scherer8 ansible_host=scherer8-buildbot.olsr # only from within freifunk-net use a jump-host or so...
buildbot-worker-l105 ansible_host=77.87.49.13 # worker VM on l105-hyp
buildbot-worker-hway-1 ansible_host=10.42.0.25
buildbot-worker-hway-2 ansible_host=10.42.0.25
buildbot-worker-hway-3 ansible_host=10.42.0.25
buildbot-worker-hway-4 ansible_host=10.42.0.25
buildbot-worker-hway-5 ansible_host=10.42.0.25
buildbot-worker-hway-6 ansible_host=10.42.0.25
buildbot-worker-hway-7 ansible_host=10.42.0.25
buildbot-worker-hway-8 ansible_host=10.42.0.25
buildbot.berlin.freifunk.net # the buildbot master runs additionally the master-worker. Thus having the worker-role too.

[tunneldigger]
Expand Down
4 changes: 3 additions & 1 deletion roles/buildbot/files/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,14 @@ def packagesArchFactory(f, wwwPrefix, wwwURL, alpineVersion):
"""\
podman run -i --rm --log-driver=none docker.io/library/alpine:%(kw:alpineVersion)s sh -c '\
( \
apk add git bash wget zstd xz gzip unzip grep diffutils findutils coreutils build-base gcc abuild binutils ncurses-dev gawk bzip2 perl python3 rsync argp-standalone musl-fts-dev musl-obstack-dev musl-libintl \
apk add git bash wget zstd xz gzip unzip grep diffutils findutils coreutils build-base gcc abuild binutils ncurses-dev gawk bzip2 perl python3 rsync argp-standalone musl-fts-dev musl-obstack-dev musl-libintl py3-distutils-extra \
&& export GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1 \
&& git clone %(prop:repository)s /root/falter-packages \
&& cd /root/falter-packages/ \
&& git checkout %(prop:got_revision)s \
&& git submodule init \
&& git submodule update \
&& git config --global url.https://git.cdn.openwrt.org/.insteadOf https://git.openwrt.org/ \
&& build/build.sh %(prop:branch)s %(prop:arch)s out/ \
) >&2 \
&& cd /root/falter-packages/out/ \
Expand Down
9 changes: 8 additions & 1 deletion roles/buildbot_worker/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
- name: Restart buildbot-worker
systemd:
daemon_reload: true
name: buildbot-worker
name: "{{ bbworker_name }}"
enabled: true
state: restarted

- name: Stop old buildbot-worker
systemd:
daemon_reload: true
name: "{{ bbworker_name }}"
enabled: false
state: stopped

- name: Initialise buildbot-worker
command: "{{ bbworker_path }}/env/bin/buildbot-worker create-worker --umask=0o22 {{ bbworker_path }} {{ bbmaster_fqdn }}:{{ bbmaster_port }} {{ bbworker_name }} {{ bbworker_pwd }}"
become_user: "{{ machine_user }}"
22 changes: 14 additions & 8 deletions roles/buildbot_worker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- name: Install dependencies for falter build system and openwrt
- name: Install dependencies
apt:
name:
- git
Expand All @@ -27,6 +27,15 @@
- Initialise buildbot-worker
- Restart buildbot-worker

- name: Add buildbot-worker systemd unit
template:
dest: /etc/systemd/system/{{ bbworker_name }}.service
src: systemd-unit.j2
mode: "0644"
owner: root
group: root
notify: Restart buildbot-worker

- name: Flush handlers
meta: flush_handlers

Expand Down Expand Up @@ -64,11 +73,8 @@
recurse: true
notify: Restart buildbot-worker

- name: Add buildbot-worker systemd-service-module
template:
- name: Remove old buildbot-worker systemd unit
file:
dest: /etc/systemd/system/buildbot-worker.service
src: systemd-unit.j2
mode: "0644"
owner: root
group: root
notify: Restart buildbot-worker
state: absent
notify: Stop old buildbot-worker
16 changes: 8 additions & 8 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
state: present
update_cache: true

- name: Configure fail2ban-jails
ansible.builtin.template:
src: fail2ban-ffberlin.local.j2
dest: /etc/fail2ban/jail.local
mode: "0640"
owner: root
group: root
notify: Restart fail2ban
# - name: Configure fail2ban-jails
# ansible.builtin.template:
# src: fail2ban-ffberlin.local.j2
# dest: /etc/fail2ban/jail.local
# mode: "0640"
# owner: root
# group: root
# notify: Restart fail2ban

- name: Copy custom motd
ansible.builtin.template:
Expand Down

0 comments on commit 83681f1

Please sign in to comment.