initial commit

This commit is contained in:
2025-09-14 13:01:12 -07:00
commit d2c9c31105
12 changed files with 964 additions and 0 deletions

33
tasks/set_hostname.yaml Normal file
View File

@ -0,0 +1,33 @@
---
- name: Get Old Hostname
shell: hostname
register: old_hostname
- name: set prop_hostname
set_fact:
prop_hostname: "{{ new_hostname }}"
- name: Add domain
set_fact:
prop_hostname: "{{ new_hostname }}.home.cosmos"
when: add_domain | bool
- name: Display hostname info
debug:
msg:
- "Old hostname was {{ old_hostname.stdout_lines[0] }}"
- "New hostname will be {{ prop_hostname }}"
- name: Rename Endpoint
hostname:
name: "{{ prop_hostname }}"
- name: Add FQDN to hosts file
lineinfile:
path: /etc/hosts
regexp: '{{ old_hostname.stdout_lines[0] }}'
line: '127.0.0.1 {{ prop_hostname }}'
...