Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
e160734a
Commit
e160734a
authored
7 years ago
by
Zuul
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Workaround for Bifrost being unable to write to /etc/hosts"
parents
3b27a9fe
376c607f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ansible/roles/bifrost/tasks/config.yml
+13
-12
13 additions, 12 deletions
ansible/roles/bifrost/tasks/config.yml
with
13 additions
and
12 deletions
ansible/roles/bifrost/tasks/config.yml
+
13
−
12
View file @
e160734a
...
...
@@ -44,15 +44,16 @@
-
{
src
:
"
id_rsa.pub"
,
dest
:
"
id_rsa.pub"
}
-
{
src
:
"
ssh_config"
,
dest
:
"
ssh_config"
}
# NOTE(mgoddard): The following two tasks were lifted from the Bifrost plays.
# Because Bifrost cannot modify /etc/hosts from within the container we must
# do it here.
-
name
:
"
RabbitMQ
-
Testing
if
hostname
is
defined
in
/etc/hosts"
command
:
grep -i "{{ ansible_hostname }}" /etc/hosts
ignore_errors
:
yes
register
:
test_grep_fix_hostname
-
name
:
"
RabbitMQ
-
Fixing
/etc/hosts"
command
:
sed -i 's/localhost/{{ ansible_hostname }} localhost/' /etc/hosts
when
:
test_grep_fix_hostname.rc !=
0
become
:
True
# NOTE(mgoddard): The following task was lifted from a Bifrost play
# (playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml). Because
# Bifrost cannot modify /etc/hosts from within the container we must do it
# here.
-
name
:
"
Ensure
/etc/hosts
has
good
defaults"
lineinfile
:
dest
:
"
/etc/hosts"
regexp
:
"
{{
item.regexp
}}.*({{
ansible_hostname
}}|localhost).*"
line
:
"
{{
item.contents
}}"
with_items
:
-
{
regexp
:
'
^127\.0\.0\.1'
,
contents
:
'
127.0.0.1
{{
ansible_hostname
}}
{{
ansible_fqdn
}}
localhost'
}
-
{
regexp
:
'
^::1'
,
contents
:
'
::1
{{
ansible_hostname
}}
{{
ansible_fqdn
}}
localhost
ipv6-localhost
ipv6-loopback'
}
become
:
true
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