Commit d5bdf7f5 authored by jpic ∞'s avatar jpic ∞ 💾
Browse files

Initial release

parents
Is your fqdn and hostname set properly ?
========================================
Run ``bigsudo yourlabs.fqdn user@host`` to fix them.
Without variables, it will question for variables and remember
them so you can run the same command without variables again.
Without target (``user@host``), it will execute on localhost.
---
galaxy_info:
author: James Pic
role_name: fqdn
description: Automatic hostname configuration
company: YourLabs
issue_tracker_url: https://yourlabs.io/oss/yourlabs.fqdn/issues
license: MIT
min_ansible_version: 1.2
platforms:
- name: GenericLinux
versions:
- all
dependencies: []
---
- include_role: name=yourlabs.remember tasks_from=questions
- name: Set hostname="{{ fqdn.split('.')[0] }}"
set_fact:
hostname: "{{ fqdn.split('.')[0] }}"
- name: Set fqdn in /etc/hosts
lineinfile:
path: /etc/hosts
regexp: '^127\.0\.0\.1 (.*)$'
line: 127.0.0.1 {{ fqdn }} \1
owner: root
group: root
mode: '0644'
- name: Set hostname in /etc/hostname
copy:
content: '{{ hostname }}'
dest: /etc/hostname
owner: root
group: root
mode: '0644'
---
rolename: yourlabs.fqdn
questions:
fqdn: |
What is the host FQDN ?
A FQDN consists of the short hostname, followed by the DNS domain name.
If you choose www.foo.com, then the hostname will be www.
If you choose staging.foo.com, then the hostname will be staging.
validation:
fqdn: '\w+\.[\w+.]+'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment