Merge branch 'ansible-services-handoff'
All checks were successful
deploy / ansible (push) Successful in 6m9s

Hand asxpio-services over to NixOS: Ansible manages asxpio-ops only.

Assisted-by: Claude:opus-5-5
This commit is contained in:
Sergei Poljanski 2026-11-17 06:07:31 +04:00
commit 827107be28
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
3 changed files with 26 additions and 10 deletions

View file

@ -17,8 +17,13 @@ all:
hosts: hosts:
asxpio-ops: asxpio-ops:
ansible_host: "{{ vpc_ip }}" ansible_host: "{{ vpc_ip }}"
services_servers: # Empty: asxpio-services runs NixOS (nixos/ on branch nix) and is
hosts: # no longer managed here
asxpio-services: services_servers: {}
ansible_host: "{{ vpc_ip }}" # Outside every play; listed only so that ops's roles can still read
ansible_ssh_common_args: "-o ProxyJump=deploy@{{ asxpio_ops_vpc_ip }}" # its variables (addresses, public IP)
nixos:
hosts:
asxpio-services:
ansible_host: "{{ vpc_ip }}"
ansible_ssh_common_args: "-o ProxyJump=deploy@{{ asxpio_ops_vpc_ip }}"

View file

@ -14,7 +14,12 @@ all:
hosts: hosts:
asxpio-ops: asxpio-ops:
ansible_host: "{{ wireguard_ip }}" ansible_host: "{{ wireguard_ip }}"
services_servers: # Empty: asxpio-services runs NixOS (nixos/ on branch nix) and is
hosts: # no longer managed here
asxpio-services: services_servers: {}
ansible_host: "{{ wireguard_ip }}" # Outside every play; listed only so that ops's roles can still read
# its variables (addresses, public IP)
nixos:
hosts:
asxpio-services:
ansible_host: "{{ wireguard_ip }}"

View file

@ -8,12 +8,16 @@
comment: xmpp-cert-sync@{{ inventory_hostname }} comment: xmpp-cert-sync@{{ inventory_hostname }}
register: xmpp_cert_sync_key register: xmpp_cert_sync_key
# The receiving end is set up here only while services is managed by
# Ansible; on NixOS it is part of nixos/hosts/asxpio-services, which
# authorizes this host's existing key until ops converts too.
- name: Install the receiving script on asxpio-services - name: Install the receiving script on asxpio-services
ansible.builtin.copy: ansible.builtin.copy:
src: xmpp-cert-install src: xmpp-cert-install
dest: /usr/local/bin/xmpp-cert-install dest: /usr/local/bin/xmpp-cert-install
mode: "0755" mode: "0755"
delegate_to: asxpio-services delegate_to: asxpio-services
when: "'asxpio-services' in groups['services_servers'] | default([])"
- name: Authorize the key for that script only, from ops only - name: Authorize the key for that script only, from ops only
ansible.posix.authorized_key: ansible.posix.authorized_key:
@ -23,7 +27,9 @@
comment: xmpp-cert-sync comment: xmpp-cert-sync
delegate_to: asxpio-services delegate_to: asxpio-services
# In a dry run on a fresh host the key does not exist yet # In a dry run on a fresh host the key does not exist yet
when: xmpp_cert_sync_key.public_key is defined when:
- xmpp_cert_sync_key.public_key is defined
- "'asxpio-services' in groups['services_servers'] | default([])"
- name: Install the sync script - name: Install the sync script
ansible.builtin.template: ansible.builtin.template: