|
1 | | -# Ansible Collection - dominion_solutions.netbird |
| 1 | +dominion_solutions.netbird |
| 2 | +--- |
| 3 | +This collection allows you to manage your netbird servers. |
2 | 4 |
|
3 | | -Documentation for the collection. |
| 5 | +- [Required Python Libraries](#required-python-libraries) |
| 6 | +- [Roles](#roles) |
| 7 | + - [dominion\_solutions.netbird.netbird](#dominion_solutionsnetbirdnetbird) |
| 8 | +- [Inventories](#inventories) |
| 9 | + - [dominion\_solutions.netbird.netbird](#dominion_solutionsnetbirdnetbird-1) |
| 10 | + - [Sample Inventory Setups](#sample-inventory-setups) |
| 11 | + - [Retrieve All Netbird Peers in the _Development_ group](#retrieve-all-netbird-peers-in-the-development-group) |
| 12 | + - [Retrieve all Netbird Peers that _are Connected_](#retrieve-all-netbird-peers-that-are-connected) |
| 13 | + - [A More Complex example](#a-more-complex-example) |
| 14 | + - [Available data for custom groupings](#available-data-for-custom-groupings) |
| 15 | +- [Contributing](#contributing) |
| 16 | +- [Contributors](#contributors) |
| 17 | + |
| 18 | + |
| 19 | +# Required Python Libraries |
| 20 | +- ansible ~=9.2.0 |
| 21 | +- requests ~=2.31.0 (If using the inventory plugin) |
| 22 | + |
| 23 | +# Roles |
| 24 | +## dominion_solutions.netbird.netbird |
| 25 | +Applying this role will install the netbird client on the target machine. |
| 26 | + |
| 27 | +[Documentation](https://galaxy.ansible.com/ui/repo/published/dominion_solutions/netbird/content/role/netbird/) |
| 28 | + |
| 29 | +# Inventories |
| 30 | +## dominion_solutions.netbird.netbird |
| 31 | +This is a dynamic inventory generated based on the configuration in the netbird API. |
| 32 | + |
| 33 | +[Documentation](https://galaxy.ansible.com/ui/repo/published/dominion_solutions/netbird/content/inventory/netbird/) |
| 34 | + |
| 35 | +### Sample Inventory Setups |
| 36 | +#### Retrieve All Netbird Peers in the _Development_ group |
| 37 | +```yaml |
| 38 | +--- |
| 39 | +plugin: dominion_solutions.netbird.netbird |
| 40 | +api_url: https://api.netbird.io/api/ |
| 41 | +api_key: nbp_this_is_a_fake_api_key |
| 42 | +netbird_groups: |
| 43 | + - Development |
| 44 | +strict: No |
| 45 | +``` |
| 46 | +
|
| 47 | +#### Retrieve all Netbird Peers that _are Connected_ |
| 48 | +```yaml |
| 49 | +--- |
| 50 | +plugin: dominion_solutions.netbird.netbird |
| 51 | +api_key: nbp_this_is_a_fake_api_key |
| 52 | +api_url: https://netbird.example.com/api/v1 |
| 53 | +netbird_connected: True |
| 54 | +``` |
| 55 | +
|
| 56 | +#### A More Complex example |
| 57 | +This example gets all peers in the _All_ group and builds the additional _connected_ and _ssh\_hosts_ groups, based on the keys. |
| 58 | +```yaml |
| 59 | +--- |
| 60 | +plugin: dominion_solutions.netbird.netbird |
| 61 | +api_key: nbp_this_is_a_fake_api_key |
| 62 | +api_url: https://netbird.example.com/api/v1 |
| 63 | +netbird_connected: False |
| 64 | +leading_separator: No |
| 65 | +netbird_groups: |
| 66 | +- "All" |
| 67 | +groups: |
| 68 | + connected: connected |
| 69 | + ssh_hosts: ssh_enabled |
| 70 | +strict: No |
| 71 | +keyed_groups: |
| 72 | +compose: |
| 73 | + ansible_ssh_host: label |
| 74 | + ansible_ssh_port: 22 |
| 75 | +``` |
| 76 | +### Available data for custom groupings |
| 77 | +Fields are taken directly from the responses at the [Netbird Peers API](https://docs.netbird.io/api/resources/peers#list-all-peers) unless otherwise indicated |
| 78 | +
|
| 79 | +| Field | Type | Notes | |
| 80 | +| ------------------------- | --------- | ----- | |
| 81 | +| label | `string` | `label` is a field generated as part of the inventory as an alias to the `dns_label` field. | |
| 82 | +| id | `string` | | |
| 83 | +| name | `string` | | |
| 84 | +| ip | `string` | | |
| 85 | +| connected | `boolean` | | |
| 86 | +| last_seen | `string` | This is is an [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) UTC Date Time String | |
| 87 | +| os | `string` | An OS Identifier such as `Linux Mint 21.3` or `Alpine Linux 3.19.1` | |
| 88 | +| version | `string` | The version of the Netbird Client that is running on the Peer | |
| 89 | +| groups | `object` | The groups object. This is parsed into the the groups in the inventory by name. | |
| 90 | +| enabled | `boolean` | | |
| 91 | +| user_id | `string` | | |
| 92 | +| hostname | `string` | The hostname part of the FQDN | |
| 93 | +| ui_version | `string` | Blank if there's no UI client installed, otherwise a version for the UI such as `netbird-desktop-ui/0.25.7` | |
| 94 | +| dns_label | `string` | The Fully Qualified Domain Name for this peer. | |
| 95 | +| login_expiration_enabled | `boolean` | Is this peer exempt from login expiration? | |
| 96 | +| login_expired | `boolean` | Is the login for this expired? | |
| 97 | +| last_login | `string` | | |
| 98 | +| approval_required | `boolean` | | |
| 99 | +| accessible_peers_count | `integer` | | |
| 100 | + |
| 101 | +# Contributing |
| 102 | +Please see [CONTRIBUTING.md](https://github.com/dominion-solutions/ansible-netbird/blob/main/.github/CONTRIBUTING.md) |
| 103 | + |
| 104 | +# Contributors |
| 105 | +- [Mark J. Horninger](https://github.com/spam-n-eggs) |
| 106 | +- [All Contributors](https://github.com/dominion-solutions/ansible-netbird/graphs/contributors) |
0 commit comments