Compare commits
2 commits
dbdf88fe36
...
f1f9d6fa34
Author | SHA1 | Date | |
---|---|---|---|
Timotej Lazar | f1f9d6fa34 | ||
Timotej Lazar | c42f9ae1f9 |
|
@ -5,3 +5,4 @@ remote_user = root
|
|||
|
||||
[privilege_escalation]
|
||||
become_method = su
|
||||
become_flags = -s /bin/sh -l
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
- name: restart networking
|
||||
service:
|
||||
name: networking
|
||||
state: restarted
|
||||
when: "'handler' not in ansible_skip_tags"
|
||||
|
||||
- name: reload sshd
|
||||
service:
|
||||
name: sshd
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
- name: Set up network interfaces
|
||||
template:
|
||||
dest: /etc/network/interfaces
|
||||
src: interfaces.j2
|
||||
notify: restart networking
|
||||
|
||||
- name: Set hostname
|
||||
hostname:
|
||||
name: '{{ dns_name }}'
|
||||
|
@ -20,6 +26,7 @@
|
|||
- name: Install base packages
|
||||
package:
|
||||
name:
|
||||
- acl
|
||||
- git
|
||||
- iproute2
|
||||
- logrotate
|
||||
|
|
17
roles/alpine/templates/interfaces.j2
Normal file
17
roles/alpine/templates/interfaces.j2
Normal file
|
@ -0,0 +1,17 @@
|
|||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
{% for iface in interfaces | selectattr('enabled') %}
|
||||
auto {{ iface.name }}
|
||||
iface {{ iface.name }} inet static
|
||||
{% for ip in iface.ip_addresses %}
|
||||
address {{ ip.address }}
|
||||
{% set subnet = ip.address | ipaddr('subnet') %}
|
||||
{% set prefix = prefixes | selectattr('prefix', '==', subnet) | first %}
|
||||
{% set gateway = prefix.custom_fields.gateway.address %}
|
||||
{% if gateway is defined %}
|
||||
gateway {{ gateway | ipaddr('address') }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
|
@ -142,7 +142,6 @@
|
|||
- name: Register runner
|
||||
become: yes
|
||||
become_user: forgejo-runner
|
||||
become_flags: '-s /bin/sh -l'
|
||||
command: |
|
||||
forgejo-runner register --no-interactive --name runner
|
||||
--instance https://git.fri.uni-lj.si
|
||||
|
|
Loading…
Reference in a new issue