Applying hosts resource in puppet to update /etc/hosts
up vote
1
down vote
favorite
Using puppet
, trying with the host
resource to update /etc/hosts
on node2.example.com
with the below entry
master.example.com 10.134.39.245
node2.example.com 10.134.39.246
For this I have created the following manifest .
node 'node2.example.com'{
host{
'master.example.com': ip => '10.134.39.245';
'node2.example.com': ip => '10.134.39.246';
}
}
But /etc/hosts
is not getting edited on node2.example.com
rhel puppet
add a comment |
up vote
1
down vote
favorite
Using puppet
, trying with the host
resource to update /etc/hosts
on node2.example.com
with the below entry
master.example.com 10.134.39.245
node2.example.com 10.134.39.246
For this I have created the following manifest .
node 'node2.example.com'{
host{
'master.example.com': ip => '10.134.39.245';
'node2.example.com': ip => '10.134.39.246';
}
}
But /etc/hosts
is not getting edited on node2.example.com
rhel puppet
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Using puppet
, trying with the host
resource to update /etc/hosts
on node2.example.com
with the below entry
master.example.com 10.134.39.245
node2.example.com 10.134.39.246
For this I have created the following manifest .
node 'node2.example.com'{
host{
'master.example.com': ip => '10.134.39.245';
'node2.example.com': ip => '10.134.39.246';
}
}
But /etc/hosts
is not getting edited on node2.example.com
rhel puppet
Using puppet
, trying with the host
resource to update /etc/hosts
on node2.example.com
with the below entry
master.example.com 10.134.39.245
node2.example.com 10.134.39.246
For this I have created the following manifest .
node 'node2.example.com'{
host{
'master.example.com': ip => '10.134.39.245';
'node2.example.com': ip => '10.134.39.246';
}
}
But /etc/hosts
is not getting edited on node2.example.com
rhel puppet
rhel puppet
edited Nov 25 at 22:45
Rui F Ribeiro
38.3k1477127
38.3k1477127
asked Mar 7 '16 at 9:32
Zama Ques
90772642
90772642
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Each host should be a separate definition. And I'm not sure about the semicolons in your snippet. Also providing aliases for your hosts is a better practice.
Maybe you could try this syntax :
node 'node2.example.com' {
host { 'master.example.com':
ip => '10.134.39.245',
host_aliases => 'master',
}
host { 'node2.example.com':
ip => '10.134.39.246',
host_aliases => 'node2',
}
}
Puppet CookBook : Add a host entry
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Each host should be a separate definition. And I'm not sure about the semicolons in your snippet. Also providing aliases for your hosts is a better practice.
Maybe you could try this syntax :
node 'node2.example.com' {
host { 'master.example.com':
ip => '10.134.39.245',
host_aliases => 'master',
}
host { 'node2.example.com':
ip => '10.134.39.246',
host_aliases => 'node2',
}
}
Puppet CookBook : Add a host entry
add a comment |
up vote
1
down vote
accepted
Each host should be a separate definition. And I'm not sure about the semicolons in your snippet. Also providing aliases for your hosts is a better practice.
Maybe you could try this syntax :
node 'node2.example.com' {
host { 'master.example.com':
ip => '10.134.39.245',
host_aliases => 'master',
}
host { 'node2.example.com':
ip => '10.134.39.246',
host_aliases => 'node2',
}
}
Puppet CookBook : Add a host entry
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Each host should be a separate definition. And I'm not sure about the semicolons in your snippet. Also providing aliases for your hosts is a better practice.
Maybe you could try this syntax :
node 'node2.example.com' {
host { 'master.example.com':
ip => '10.134.39.245',
host_aliases => 'master',
}
host { 'node2.example.com':
ip => '10.134.39.246',
host_aliases => 'node2',
}
}
Puppet CookBook : Add a host entry
Each host should be a separate definition. And I'm not sure about the semicolons in your snippet. Also providing aliases for your hosts is a better practice.
Maybe you could try this syntax :
node 'node2.example.com' {
host { 'master.example.com':
ip => '10.134.39.245',
host_aliases => 'master',
}
host { 'node2.example.com':
ip => '10.134.39.246',
host_aliases => 'node2',
}
}
Puppet CookBook : Add a host entry
edited Mar 7 '16 at 10:12
Jeff Schaller
37k1052121
37k1052121
answered Mar 7 '16 at 9:57
Moonchild
1284
1284
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f268140%2fapplying-hosts-resource-in-puppet-to-update-etc-hosts%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown