Ansible same host excludes himself in host_definition












0















I am struggling currently with my ansible host configuration.



I have two Playbooks which performs the following tasks:



playA : Copys build files from BuildServer to localhost (hosts: build_server[0])
playB : Copys build files from localhost to X target Systems (eg hosts: all,!build_server)


Following is the host file configuration:



Development Env:



[build_server]
build.server.intranet ansible_user=jenkins
[target_server]
build.server.intranet ansible_user=http


Production Env:



[build_server]
build.server.intranet
[GroupA]
serverXY.a
serverZ.a
[GroupB]
serverXY.b
serverZ.b


My deployment into production works fine but I cannot deploy anymore to development.



So my question: How can I execute a playbook from one host and the other on each other hosts, but with the edge case that my build_host can be my deploy_host ???



or as an alternative



How can i specify any static host which is not listed in my host definition?










share|improve this question

























  • Honestly, I don't get it. You have the following systems: - Controller (which you mean by localhost?) - a build server (which you use for both inventories (development and production) - and a target server (that exists only in development but not in production) First question, what are the groups for? are they relevant here? Second: is the build_server playbook run for production just green? If it really is the same host, than that should be the expected behavior

    – Hoall
    Nov 15 '18 at 13:32


















0















I am struggling currently with my ansible host configuration.



I have two Playbooks which performs the following tasks:



playA : Copys build files from BuildServer to localhost (hosts: build_server[0])
playB : Copys build files from localhost to X target Systems (eg hosts: all,!build_server)


Following is the host file configuration:



Development Env:



[build_server]
build.server.intranet ansible_user=jenkins
[target_server]
build.server.intranet ansible_user=http


Production Env:



[build_server]
build.server.intranet
[GroupA]
serverXY.a
serverZ.a
[GroupB]
serverXY.b
serverZ.b


My deployment into production works fine but I cannot deploy anymore to development.



So my question: How can I execute a playbook from one host and the other on each other hosts, but with the edge case that my build_host can be my deploy_host ???



or as an alternative



How can i specify any static host which is not listed in my host definition?










share|improve this question

























  • Honestly, I don't get it. You have the following systems: - Controller (which you mean by localhost?) - a build server (which you use for both inventories (development and production) - and a target server (that exists only in development but not in production) First question, what are the groups for? are they relevant here? Second: is the build_server playbook run for production just green? If it really is the same host, than that should be the expected behavior

    – Hoall
    Nov 15 '18 at 13:32
















0












0








0








I am struggling currently with my ansible host configuration.



I have two Playbooks which performs the following tasks:



playA : Copys build files from BuildServer to localhost (hosts: build_server[0])
playB : Copys build files from localhost to X target Systems (eg hosts: all,!build_server)


Following is the host file configuration:



Development Env:



[build_server]
build.server.intranet ansible_user=jenkins
[target_server]
build.server.intranet ansible_user=http


Production Env:



[build_server]
build.server.intranet
[GroupA]
serverXY.a
serverZ.a
[GroupB]
serverXY.b
serverZ.b


My deployment into production works fine but I cannot deploy anymore to development.



So my question: How can I execute a playbook from one host and the other on each other hosts, but with the edge case that my build_host can be my deploy_host ???



or as an alternative



How can i specify any static host which is not listed in my host definition?










share|improve this question
















I am struggling currently with my ansible host configuration.



I have two Playbooks which performs the following tasks:



playA : Copys build files from BuildServer to localhost (hosts: build_server[0])
playB : Copys build files from localhost to X target Systems (eg hosts: all,!build_server)


Following is the host file configuration:



Development Env:



[build_server]
build.server.intranet ansible_user=jenkins
[target_server]
build.server.intranet ansible_user=http


Production Env:



[build_server]
build.server.intranet
[GroupA]
serverXY.a
serverZ.a
[GroupB]
serverXY.b
serverZ.b


My deployment into production works fine but I cannot deploy anymore to development.



So my question: How can I execute a playbook from one host and the other on each other hosts, but with the edge case that my build_host can be my deploy_host ???



or as an alternative



How can i specify any static host which is not listed in my host definition?







ansible






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 9:25









common sense

2,57351625




2,57351625










asked Nov 15 '18 at 8:29









42tg42tg

43138




43138













  • Honestly, I don't get it. You have the following systems: - Controller (which you mean by localhost?) - a build server (which you use for both inventories (development and production) - and a target server (that exists only in development but not in production) First question, what are the groups for? are they relevant here? Second: is the build_server playbook run for production just green? If it really is the same host, than that should be the expected behavior

    – Hoall
    Nov 15 '18 at 13:32





















  • Honestly, I don't get it. You have the following systems: - Controller (which you mean by localhost?) - a build server (which you use for both inventories (development and production) - and a target server (that exists only in development but not in production) First question, what are the groups for? are they relevant here? Second: is the build_server playbook run for production just green? If it really is the same host, than that should be the expected behavior

    – Hoall
    Nov 15 '18 at 13:32



















Honestly, I don't get it. You have the following systems: - Controller (which you mean by localhost?) - a build server (which you use for both inventories (development and production) - and a target server (that exists only in development but not in production) First question, what are the groups for? are they relevant here? Second: is the build_server playbook run for production just green? If it really is the same host, than that should be the expected behavior

– Hoall
Nov 15 '18 at 13:32







Honestly, I don't get it. You have the following systems: - Controller (which you mean by localhost?) - a build server (which you use for both inventories (development and production) - and a target server (that exists only in development but not in production) First question, what are the groups for? are they relevant here? Second: is the build_server playbook run for production just green? If it really is the same host, than that should be the expected behavior

– Hoall
Nov 15 '18 at 13:32














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315180%2fansible-same-host-excludes-himself-in-host-definition%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315180%2fansible-same-host-excludes-himself-in-host-definition%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Bressuire

Vorschmack

Quarantine