Skip to content

Commit

Permalink
update shoelaces binary to support talos
Browse files Browse the repository at this point in the history
  • Loading branch information
estenrye committed Jan 2, 2023
1 parent 6b5ed9c commit c765edd
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 7 deletions.
13 changes: 11 additions & 2 deletions ansible/playbooks/tools.rye.ninja/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tools_server:
httpd_modules:
- proxy
- proxy_http
- remoteip
- headers
httpd_sites_enabled:
- site: 000-default.conf
Expand Down Expand Up @@ -38,7 +39,8 @@ tools_server:
allowOverride: None
require: all granted
proxyPreserveHost: true
requestHeader: set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
requestHeaders:
- set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
proxyPass:
- from: /
to: http://127.0.0.1:30083/
Expand Down Expand Up @@ -69,7 +71,8 @@ tools_server:
- site: 102-pihole.conf
host: pihole.tools.rye.ninja
proxyPreserveHost: true
requestHeader: set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
requestHeaders:
- set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
proxyPass:
- from: /
to: http://127.0.0.1:30085/
Expand Down Expand Up @@ -115,3 +118,9 @@ tools_server:
bios_type: bios
hostname: zbox-01.usmnblm01.rye.ninja
password_hash: "{{ default_automation_user_passwordhash | urlencode }}"
- network: 10.5.11.2/32
script:
name: talos.ipxe
params:
arch: amd64
hostname: zbox-02.usmnblm01.rye.ninja
1 change: 1 addition & 0 deletions ansible/playbooks/tools.rye.ninja/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
- netbox
- tftp
- httpd
- shoelaces

- hosts: tools_server
roles:
Expand Down
32 changes: 28 additions & 4 deletions ansible/roles/httpd/templates/site.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ServerAdmin {{ site.serverAdmin }}
{% endif %}

{% if site.proxyPreserveHost is defined and site.proxyPreserveHost %}
{% if site.proxyPreserveHost | default(false) %}
ProxyPreserveHost On
{% endif %}

Expand Down Expand Up @@ -67,10 +67,34 @@ SSLCertificateKeyFile {{ ssl.key }}
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

{% if site.requestHeader is defined %}
RequestHeader {{ site.requestHeader }}
{% if site.remoteIPHeader is defined %}
RemoteIPHeader {{ site.remoteIpHeader }}
{% endif %}
{% for remoteIPInternalProxy in site.remoteIPInternalProxy | default([]) %}
RemoteIPInternalProxy {{ remoteIPInternalProxy }}
{% endfor %}
{% if site.remoteIPInternalProxyList is defined %}
RemoteIPInternalProxyList {{ site.remoteIPInternalProxyList }}
{% endif %}
{% if site.remoteIPProxiesHeader is defined %}
RemoteIPProxiesHeader {{ site.remoteIPProxiesHeader }}
{% endif %}
{% if site.remoteIPProxyProtocol | default(false) %}
RemoteIPProxyProtocol On
{% endif %}
{% if site.remoteIPProxyProtocolExceptions is defined %}
RemoteIPProxyProtocolExceptions {{ site.remoteIPProxyProtocolExceptions | join(' ') }}
{% endif %}
{% for remoteIPTrustedProxy in site.RemoteIPTrustedProxys | default([]) %}
RemoteIPTrustedProxy {{ remoteIPTrustedProxy }}
{% endfor %}
{% if site.remoteIPTrustedProxyList is defined %}
RemoteIPTrustedProxyList {{ site.remoteIPTrustedProxyList }}
{% endif %}

{% for requestHeader in site.requestHeaders | default([]) %}
RequestHeader {{ requestHeader }}
{% endfor %}
{% for proxyPass in site.proxyPass | default([]) %}
ProxyPass {{ proxyPass.from }} {{ proxyPass.to }}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/shoelaces/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
shoelaces_version: 1.2.4
shoelaces_version: 1.2.18
shoelaces_repo_url: https://github.com/estenrye/shoelaces
shoelaces_system: "{{ ansible_system | lower }}"
shoelaces_arch: "{% if ansible_architecture == 'x86_64' %}amd64{% else %}arm64{% endif %}"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/shoelaces/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
owner: root
group: root
become: true
notify: restart shoelaces

- name: create shoelaces configuration directory
ansible.builtin.file:
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/tftp/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ image_mirror_dir: "{{ tftp_directory }}/images"
imagemirror_on_calendar: '*-*-* 02/6:30:00'
imagemirror_accuracy_sec: 1m

talos_linux_version: v1.3.0
image_mirrors:
- name: ubuntu
mirror: rsync://mirror.math.princeton.edu/pub/ubuntu-iso/
Binary file modified ansible/roles/tftp/files/undionly.shoelaces.kpxe
Binary file not shown.
16 changes: 16 additions & 0 deletions ansible/roles/tftp/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- "{{ tftp_directory }}/boot"
- "{{ tftp_directory }}/boot/bios"
- "{{ tftp_directory }}/boot/efi64"
- "{{ tftp_directory }}/boot/talos"
- "{{ image_mirror_dir }}"
- "{{ image_mirror_dir }}/bin"
- "{{ image_mirror_dir }}/status"
Expand Down Expand Up @@ -106,6 +107,21 @@
- src: initrd
dest: "{{ tftp_directory }}/boot/efi64/initrd"

- name: download talos linux kernel
ansible.builtin.get_url:
url: https://github.com/siderolabs/talos/releases/download/{{ talos_linux_version }}/{{ talos_kernel_file }}
dest: "{{ tftp_directory }}/boot/talos/{{ talos_kernel_file }}"
owner: "{{ tftp_user }}"
group: "{{ tftp_group }}"
become: true
loop_control:
loop_var: talos_kernel_file
loop:
- initramfs-amd64.xz
- initramfs-arm64.xz
- vmlinuz-amd64
- vmlinuz-arm64

- name: Create Configuration Files
ansible.builtin.template:
src: tftpd-hpa.conf.j2
Expand Down

0 comments on commit c765edd

Please sign in to comment.