-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add examples for various inventory setups to the documentation #62323
Add examples for various inventory setups to the documentation #62323
Conversation
Thanks @zerok for submitting these examples. We appreciate the time and effort you've put in. If you're interested in documentation, please consider joining the Docs Working Group! Can you take a look at the comments above? If you have questions, need clarification, etc., feel free to reach out on the #ansible-docs channel on freenode IRC. |
Thank you 😊I will try to find time for implementing your comments tomorrow 🙂
… On 17.09.2019, at 16:04, Sandra McCann ***@***.***> wrote:
@samccann commented on this pull request.
In docs/docsite/rst/user_guide/intro_inventory.rst:
> +nodes inside the "test" environment when you actually wanted to update
+some "staging" servers.
+
+For the example mentioned above you could have an
+:file:`inventory_test` file::
+
+ [database-servers]
+ db01.test.example.com
+ db02.test.example.com
+
+ [app-servers]
+ app01.test.example.com
+ app02.test.example.com
+ app03.test.example.com
+
+In there are only host that are part of the "test"
⬇️ Suggested change
-In there are only host that are part of the "test"
+That file only includes hosts that are part of the "test"
In docs/docsite/rst/user_guide/intro_inventory.rst:
> +some "staging" servers.
+
+For the example mentioned above you could have an
+:file:`inventory_test` file::
+
+ [database-servers]
+ db01.test.example.com
+ db02.test.example.com
+
+ [app-servers]
+ app01.test.example.com
+ app02.test.example.com
+ app03.test.example.com
+
+In there are only host that are part of the "test"
+environment. "Staging" machines would be defined in another file
⬇️ Suggested change
-environment. "Staging" machines would be defined in another file
+environment. Define the "staging" machines in another file
In docs/docsite/rst/user_guide/intro_inventory.rst:
> + app03.test.example.com
+
+In there are only host that are part of the "test"
+environment. "Staging" machines would be defined in another file
+called :file:`inventory_staging`::
+
+ [database-servers]
+ db01.staging.example.com
+ db02.staging.example.com
+
+ [app-servers]
+ app01.staging.example.com
+ app02.staging.example.com
+ app03.staging.example.com
+
+If you then have a playbook called :file:`site.yml`, then you'd apply
⬇️ Suggested change
-If you then have a playbook called :file:`site.yml`, then you'd apply
+To apply a playbook called :file:`site.yml`
In docs/docsite/rst/user_guide/intro_inventory.rst:
> +
+In there are only host that are part of the "test"
+environment. "Staging" machines would be defined in another file
+called :file:`inventory_staging`::
+
+ [database-servers]
+ db01.staging.example.com
+ db02.staging.example.com
+
+ [app-servers]
+ app01.staging.example.com
+ app02.staging.example.com
+ app03.staging.example.com
+
+If you then have a playbook called :file:`site.yml`, then you'd apply
+that to all the app-servers in the test environment using the
⬇️ Suggested change
-that to all the app-servers in the test environment using the
+to all the app-servers in the test environment, use the
In docs/docsite/rst/user_guide/intro_inventory.rst:
> +
+If you then have a playbook called :file:`site.yml`, then you'd apply
+that to all the app-servers in the test environment using the
+following command::
+
+ ansible-playbook -i inventory_test site.yml -l app-servers
+
+.. _inventory_setup-per_function:
+
+Example: Group by function
+--------------------------
+
+In the previous section you already saw an example for using groups in
+order to cluster hosts that have the same function. This allows you,
+for instance, to define firewall rules inside a playbook or role
+without affecting database servers::
please use code-block here
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Co-Authored-By: Sandra McCann <samccann@redhat.com>
Co-Authored-By: Sandra McCann <samccann@redhat.com>
Co-Authored-By: Sandra McCann <samccann@redhat.com>
Co-Authored-By: Sandra McCann <samccann@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover nit from removing the dash from the groups :-)
Co-Authored-By: Sandra McCann <samccann@redhat.com>
Thanks @zerok for the inventory examples! |
…le#62323) * Add examples for various inventory setups to the documentation. This closes ansible#12480. * Update docs/docsite/rst/user_guide/intro_inventory.rst Co-Authored-By: Sandra McCann <samccann@redhat.com> * Update docs/docsite/rst/user_guide/intro_inventory.rst Co-Authored-By: Sandra McCann <samccann@redhat.com> * Update wording in inventory examples Co-Authored-By: Sandra McCann <samccann@redhat.com> * Update wording in inventory examples Co-Authored-By: Sandra McCann <samccann@redhat.com> * Use code-block and rename groups in inventory setup examples * Fix group name in inventory setup example Co-Authored-By: Sandra McCann <samccann@redhat.com>
…le#62323) * Add examples for various inventory setups to the documentation. This closes ansible#12480. * Update docs/docsite/rst/user_guide/intro_inventory.rst Co-Authored-By: Sandra McCann <samccann@redhat.com> * Update docs/docsite/rst/user_guide/intro_inventory.rst Co-Authored-By: Sandra McCann <samccann@redhat.com> * Update wording in inventory examples Co-Authored-By: Sandra McCann <samccann@redhat.com> * Update wording in inventory examples Co-Authored-By: Sandra McCann <samccann@redhat.com> * Use code-block and rename groups in inventory setup examples * Fix group name in inventory setup example Co-Authored-By: Sandra McCann <samccann@redhat.com> (cherry picked from commit 7047b66)
* Update pip module docs (#62359) * Clarifying pip module requirements in reference to #47361 * Further clarifying message with link to ansible_python_interpreter (cherry picked from commit d3ec5ca) * chore/doc-module: sts_assume_role.py (#62475) Update `Example` section with with the correct module usage. (cherry picked from commit a4a2166) * Improve dconf documentation to include conversion problems (#62316) (cherry picked from commit 8649283) * Add examples for various inventory setups to the documentation (#62323) * Updates docs/docsite/rst/user_guide/intro_inventory.rst, closes #12480. * Use code-block and rename groups in inventory setup examples * Fix group name in inventory setup example Co-Authored-By: Sandra McCann <samccann@redhat.com> (cherry picked from commit 7047b66) * added networking porting guide info (#61999) * Update docs/docsite/rst/porting_guides/porting_guide_2.9.rst Co-Authored-By: Nathaniel Case <this.is@nathanielca.se> (cherry picked from commit 6d35f90) * [docs] split collections into user and dev guide sections (#62363) (cherry picked from commit 7badeb6) * fixed options (#62605) (cherry picked from commit 170b4e6) * ec2_vpc_subnet: Rename resource_tags > tags (#62663) Most of the AWS module documentation refers to `tags` and not `resource_tags`. This patch updates the documentation to match other AWS module documentation. 😉 Signed-off-by: Major Hayden <major@redhat.com> (cherry picked from commit cced1a3) * [Docs] Document the resource module builder (#62222) (cherry picked from commit b17581a) * Fix link syntax and a typo in dev collections doc (#62650) (cherry picked from commit 2969614) * hcloud_volume: clarify volume size units (#62771) (cherry picked from commit 190b8fc) * ovirt_host update force doc (#62491) (cherry picked from commit 3b2b418) * update example document for zabbix_action module (#62667) (cherry picked from commit 3299f29)
Fixes: #12480.