https://github.com/jalseth/ansible-nocloud-metadata-server
Ansible role for https://github.com/jalseth/nocloud-metadata-server
https://github.com/jalseth/ansible-nocloud-metadata-server
cloud-init nocloud
Last synced: over 1 year ago
JSON representation
Ansible role for https://github.com/jalseth/nocloud-metadata-server
- Host: GitHub
- URL: https://github.com/jalseth/ansible-nocloud-metadata-server
- Owner: jalseth
- Created: 2023-03-18T19:00:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-11T18:18:38.000Z (over 3 years ago)
- Last Synced: 2025-03-11T08:52:53.206Z (over 1 year ago)
- Topics: cloud-init, nocloud
- Language: Jinja
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ansible-nocloud-metadata-server
Installs and configures an instance of the
[NoCloud Metadata Server](https://github.com/jalseth/nocloud-metadata-server).
## Installation
```sh
ansible-galaxy install jalseth.nocloud_metadata_server
```
### Python dependencies
- `jmespath` for JSON parsing
```sh
pip install --user jmespath
```
## Usage
You may wish to configure a server with multiple instances of the NoCloud
Metadata server, such as separating instances per VLAN that serve different
server types. The example below demonstrates such a configuration.
```yaml
name: Configure NoCloud Metadata Server
hosts: your.host.name
become: true
tasks:
- name: Install NMS server binary
include_role:
name: jalseth.nocloud_metadata_server
vars:
nocloud_metadata_server_enable_systemd: false
nocloud_metadata_server_config: {}
- name: Configure NMS instances
include_role:
name: jalseth.nocloud_metadata_server
vars:
nocloud_metadata_server_systemd_service_name: "nocloud-metadata-server-{{ nms.name }}"
nocloud_metadata_server_systemd_service_file_path: "/lib/systemd/system/nocloud-metadata-server-{{ nms.name}}.service"
nocloud_metadata_server_config_file_path: "/etc/nocloud-metadata-server-{{ nms.name }}.yaml"
nocloud_metadata_server_config: "{{ nms.config }}"
with_items:
- name: vlan123
config:
listenAddress: "10.10.123.2"
matchPatterns: ["123"]
instanceConfig:
hostname: onetwothree
enableInstanceIDSuffix: true
enableHostnameSuffix: true
- name: vlan234
config:
listenAddress: "10.10.234.2"
matchPatterns: ["234"]
instanceConfig:
hostname: twothreefour
enableInstanceIDSuffix: true
enableHostnameSuffix: true
loop_control:
loop_var: nms
```