Last active
May 29, 2018 20:45
-
-
Save fia5000/f9c599716c526f000af82a5a198f6244 to your computer and use it in GitHub Desktop.
v2 Inventory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DEV_CPE_SERVERS] | |
DEV_CPE_NODE_1 ansible_host=x.x.x.x | |
[TEST_CPE_SERVERS] | |
TEST_CPE_NODE_1 ansible_host=x.x.x.x | |
[RUN_CPE_SERVERS] | |
RUN_CPE_NODE_1 ansible_host=x.x.x.x | |
RUN_CPE_NODE_2 ansible_host=x.x.x.x | |
[DEV_ICN_SERVERS] | |
DEV_ICN_NODE_1 ansible_host=x.x.x.x | |
[TEST_ICN_SERVERS] | |
TEST_ICN_NODE_1 ansible_host=x.x.x.x | |
[RUN_ICN_SERVERS] | |
RUN_ICN_NODE_1 ansible_host=x.x.x.x | |
RUN_ICN_NODE_2 ansible_host=x.x.x.x | |
[DEV_DB2_SERVERS] | |
DEV_DB2_NODE_1 ansible_host=x.x.x.x | |
DEV_DB2_NODE_1 ansible_host=x.x.x.x | |
DEV_DB2_AUX_NODE_1 ansible_host=x.x.x.x | |
DEV_DB2_AUX_NODE_2 ansible_host=x.x.x.x | |
[RUN_DB2_SERVERS] | |
RUN_DB2_NODE_1 ansible_host=x.x.x.x | |
RUN_DB2_NODE_1 ansible_host=x.x.x.x | |
RUN_DB2_AUX_NODE_1 ansible_host=x.x.x.x | |
RUN_DB2_AUX_NODE_2 ansible_host=x.x.x.x | |
[RUN_BJ_SERVERS] | |
BJ_NODE_1 ansible_host=x.x.x.x | |
BJ_NODE_2 ansible_host=x.x.x.x | |
[RUN_SDS_SERVERS] | |
RUN_SDS_NODE_1 ansible_host=x.x.x.x | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[RUN_CPE_SERVERS] | |
RUN_CPE_NODE_1 ansible_host=x.x.x.x | |
[RUN_ICN_SERVERS] | |
RUN_ICN_NODE_1 ansible_host=x.x.x.x | |
[RUN_DB2_SERVERS] | |
RUN_DB2_NODE_1 ansible_host=x.x.x.x | |
[RUN_BJ_SERVERS] | |
RUN_BJ_NODE_1 ansible_host=x.x.x.x | |
[RUN_SDS_SERVERS] | |
RUN_SDS_NODE_1 ansible_host=x.x.x.x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The idea is that the Inventory and host name will have a
prefix
for the environment it is meant for:when: "{{ env | upper}}_CPE_SERVERS in group_names"
orwhen: "{{ env | upper }}_CPE_NODE_1 in inventory_hostnames"
env
itself can be set by various means. We can either pass an extra variable at the time of playbook execution (likely the cleanest), or as an environment variable.... OR within a playbook, we canset_fact
like so: