Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
e6ff8c92
Commit
e6ff8c92
authored
7 years ago
by
Oliver Moser
Committed by
Matthew Mosesohn
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Using 'hostnamectl' to set unconfigured hostname on CoreOS (#1600)
parent
9bce364b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/bootstrap-os/tasks/main.yml
+14
-3
14 additions, 3 deletions
roles/bootstrap-os/tasks/main.yml
with
14 additions
and
3 deletions
roles/bootstrap-os/tasks/main.yml
+
14
−
3
View file @
e6ff8c92
...
@@ -21,9 +21,20 @@
...
@@ -21,9 +21,20 @@
-
name
:
Gather nodes hostnames
-
name
:
Gather nodes hostnames
setup
:
setup
:
gather_subset
:
'
!all'
gather_subset
:
'
!all'
filter
:
ansible_
hostname
filter
:
ansible_
*
-
name
:
Assign inventory name to unconfigured hostnames
-
name
:
Assign inventory name to unconfigured hostnames
(non-CoreOS)
hostname
:
hostname
:
name
:
"
{{inventory_hostname}}"
name
:
"
{{inventory_hostname}}"
when
:
ansible_hostname == 'localhost'
when
:
ansible_os_family not in ['CoreOS', 'Container Linux by CoreOS']
-
name
:
Assign inventory name to unconfigured hostnames (CoreOS only)
command
:
"
hostnamectl
set-hostname
{{inventory_hostname}}"
register
:
hostname_changed
when
:
ansible_hostname == 'localhost' and ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
-
name
:
Update hostname fact (CoreOS only)
setup
:
gather_subset
:
'
!all'
filter
:
ansible_hostname
when
:
ansible_os_family in ['CoreOS', 'Container Linux by CoreOS'] and hostname_changed.changed
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment