Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Export hostname via __target_host_name #124

Closed
telmich opened this Issue Nov 14, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

telmich commented Nov 14, 2012

The __target_host variable contains whatever a user specified.
To allow the user to rely on a variable that contains the hostname (without domain), the variable __target_host_name should be exported, with only containing everything until excluding the first dot.

Domain handling can be done by the user better than from the cdist core, for instance by adding conf/manifest/domain which contains

domain="my.local.domain.example.org"
Contributor

telmich commented Nov 14, 2012

Good comment from sar:

16:13 < sar> telmich: echo "${__target_host%%.*}", problem solved

Contributor

jdguffey commented Nov 14, 2012

What if a user provides an IP address rather than a hostname?

On Nov 14, 2012, at 10:22 AM, Nico Schottelius notifications@github.com wrote:

Good comment from sar:

16:13 < sar> telmich: echo "${__target_host%%.*}", problem solved


Reply to this email directly or view it on GitHub.

Contributor

telmich commented Nov 19, 2012

good point. maybe we need to check if it is an IPv4 address and if so, keep it as it is

Contributor

telmich commented Jan 14, 2014

I think we do not need to fix this anymore - shell can handle this easily.

@telmich telmich closed this Jan 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment