Skip to content

add tor_instances fact - #247

Open
jcgl17 wants to merge 2 commits into
nusenu:masterfrom
jcgl17:add_tor_instances_fact
Open

add tor_instances fact#247
jcgl17 wants to merge 2 commits into
nusenu:masterfrom
jcgl17:add_tor_instances_fact

Conversation

@jcgl17

@jcgl17 jcgl17 commented Aug 27, 2024

Copy link
Copy Markdown

This set_fact call gives other roles access to the ipv4+orport combination that is used to key various things, such as service instances and the various CSV files used by relayor. That makes it easier for other roles to compose neatly with relayor.

@jcgl17

jcgl17 commented Feb 4, 2025

Copy link
Copy Markdown
Author

Made this a little more useful. Now the output looks something like this:

{
  "relay1.example.com-192.0.2.1_9002": {
    "instance_id_unqualified": "192.0.2.1_9002",
    "ipv4": "192.0.2.1",
    "ipv6": "2001:db8::1",
    "port": { "dirport": 0, "orport": 9002 }
  },
  "relay1.example.com-192.0.2.1_9004": {
    "instance_id_unqualified": "192.0.2.1_9004",
    "ipv4": "192.0.2.1",
    "ipv6": "2001:db8::1",
    "port": { "dirport": 0, "orport": 9004 }
  }
}

The top-level JSON keys are what is needed to select from relayor's various CSV files (e.g. to get an instance's nickname). instance_id_unqualified is a string that I've seen used in systemd service names on Linux (e.g. tor@192.0.2.1_9004.service).

This commit is backwards-incompatible with the last one, but now it has a flexible schema which shouldn't have to make further backwards-incompatible changes.

@jcgl17

jcgl17 commented Jul 5, 2025

Copy link
Copy Markdown
Author

Rebased cleanly against v25.0.0.

jcgl17 added 2 commits April 7, 2026 19:57
This set_fact call gives other roles access to the ipv4+orport
combination that is used to key various things, such as service
instances and the various CSV files used by relayor. That makes it
easier for other roles to compose neatly with relayor.
Not only is this more useful than just the flat list of ipv4+orport
strings, but it also provides a way to add more data here in future
without breaking backwards compatibility (like this change does)
@jcgl17
jcgl17 force-pushed the add_tor_instances_fact branch from 1cb5659 to 15dae69 Compare April 7, 2026 18:04
@jcgl17

jcgl17 commented Apr 7, 2026

Copy link
Copy Markdown
Author

Rebased cleanly against v26.0.0.

@nusenu

nusenu commented Apr 18, 2026 via email

Copy link
Copy Markdown
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants