add hostname role

This commit is contained in:
Sergey Malyuk
2026-03-18 17:35:08 +03:00
parent 60459d34d9
commit e9802e7c35
6 changed files with 65 additions and 0 deletions

39
roles/hostname/README.md Normal file
View File

@@ -0,0 +1,39 @@
Role Name
=========
Set the node's hostname.
Requirements
------------
None
Role Variables
--------------
`hostname`
Dependencies
------------
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
```yaml
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
```
License
-------
BSD
Author Information
------------------
corvus-migratorius@proton.me

View File

@@ -0,0 +1,2 @@
---
# defaults file for roles/hostname

View File

@@ -0,0 +1,2 @@
---
# handlers file for roles/hostname

View File

@@ -0,0 +1,14 @@
galaxy_info:
author: "Alexander Gorelyhsev"
description: "Set the hostname of the node"
company: "GenLab LLC"
license: "BSD"
min_ansible_version: "2.1"
platforms:
- name: "Ubuntu"
versions: ["focal", "jammy", "noble"]
galaxy_tags: []
dependencies: []

View File

@@ -0,0 +1,6 @@
---
# tasks file for roles/hostname
- name: "Set the hostname to '{{ hostname }}'"
tags: [ hostname ]
ansible.builtin.hostname:
name: "{{ hostname }}"

View File

@@ -0,0 +1,2 @@
---
# vars file for roles/hostname