From ecea0185064b4ce8932917702a84962a75280fcf Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 17 Aug 2020 23:22:45 +0530 Subject: [PATCH] Fix 404 links (#71256) Signed-off-by: Abhijeet Kasurde --- docs/docsite/rst/dev_guide/testing_units.rst | 17 +++++------------ .../docsite/rst/scenario_guides/guide_azure.rst | 8 ++++---- .../rst/scenario_guides/guide_docker.rst | 2 +- .../rst/scenario_guides/guide_infoblox.rst | 4 ++-- .../vmware_external_doc_links.rst | 1 - .../vmware_scenarios/vmware_requirements.rst | 2 +- .../rst/user_guide/intro_dynamic_inventory.rst | 10 +++++----- 7 files changed, 18 insertions(+), 26 deletions(-) diff --git a/docs/docsite/rst/dev_guide/testing_units.rst b/docs/docsite/rst/dev_guide/testing_units.rst index 4cc07face0b..7573da6f5ba 100644 --- a/docs/docsite/rst/dev_guide/testing_units.rst +++ b/docs/docsite/rst/dev_guide/testing_units.rst @@ -153,10 +153,8 @@ directory, which is then included directly. Module test case common code ```````````````````````````` -Keep common code as specific as possible within the `test/units/` directory structure. For -example, if it's specific to testing Amazon modules, it should be in -`test/units/modules/cloud/amazon/`. Don't import common unit test code from directories -outside the current or parent directories. +Keep common code as specific as possible within the `test/units/` directory structure. +Don't import common unit test code from directories outside the current or parent directories. Don't import other unit tests from a unit test. Any common code should be in dedicated files that aren't themselves tests. @@ -168,15 +166,10 @@ Fixtures files To mock out fetching results from devices, or provide other complex data structures that come from external libraries, you can use ``fixtures`` to read in pre-generated data. -Text files live in ``test/units/modules/network/PLATFORM/fixtures/`` +You can check how `fixtures `_ +are used in `cpuinfo fact tests `_ -Data is loaded using the ``load_fixture`` method - -See `eos_banner test -`_ -for a practical example. - -If you are simulating APIs you may find that python placebo is useful. See +If you are simulating APIs you may find that Python placebo is useful. See :ref:`testing_units_modules` for more information. diff --git a/docs/docsite/rst/scenario_guides/guide_azure.rst b/docs/docsite/rst/scenario_guides/guide_azure.rst index 9daaf5e2530..7a3ac728f42 100644 --- a/docs/docsite/rst/scenario_guides/guide_azure.rst +++ b/docs/docsite/rst/scenario_guides/guide_azure.rst @@ -286,14 +286,14 @@ Dynamic Inventory Script If you are not familiar with Ansible's dynamic inventory scripts, check out :ref:`Intro to Dynamic Inventory `. -The Azure Resource Manager inventory script is called `azure_rm.py `_. It authenticates with the Azure API exactly the same as the +The Azure Resource Manager inventory script is called `azure_rm.py `_. It authenticates with the Azure API exactly the same as the Azure modules, which means you will either define the same environment variables described above in `Using Environment Variables`_, create a ``$HOME/.azure/credentials`` file (also described above in `Storing in a File`_), or pass command line parameters. To see available command line options execute the following: .. code-block:: bash - $ wget https://raw.githubusercontent.com/ansible-collections/community.general/master/scripts/inventory/azure_rm.py + $ wget https://raw.githubusercontent.com/ansible-collections/community.general/main/scripts/inventory/azure_rm.py $ ./azure_rm.py --help As with all dynamic inventory scripts, the script can be executed directly, passed as a parameter to the ansible command, @@ -397,7 +397,7 @@ If you don't need the powerstate, you can improve performance by turning off pow * AZURE_INCLUDE_POWERSTATE=no A sample azure_rm.ini file is included along with the inventory script in -`here `_. +`here `_. An .ini file will contain the following: .. code-block:: ini @@ -432,7 +432,7 @@ Here are some examples using the inventory script: .. code-block:: bash # Download inventory script - $ wget https://raw.githubusercontent.com/ansible-collections/community.general/master/scripts/inventory/azure_rm.py + $ wget https://raw.githubusercontent.com/ansible-collections/community.general/main/scripts/inventory/azure_rm.py # Execute /bin/uname on all instances in the Testing resource group $ ansible -i azure_rm.py Testing -m shell -a "/bin/uname -a" diff --git a/docs/docsite/rst/scenario_guides/guide_docker.rst b/docs/docsite/rst/scenario_guides/guide_docker.rst index c834cc919ff..a237b2e6c0f 100644 --- a/docs/docsite/rst/scenario_guides/guide_docker.rst +++ b/docs/docsite/rst/scenario_guides/guide_docker.rst @@ -204,7 +204,7 @@ examples to get you started: Configuration ............. You can control the behavior of the inventory script by defining environment variables, or -creating a docker.yml file (sample provided in https://raw.githubusercontent.com/ansible-collections/community.general/master/scripts/inventory/docker.py). The order of precedence is the docker.yml +creating a docker.yml file (sample provided in https://raw.githubusercontent.com/ansible-collections/community.general/main/scripts/inventory/docker.py). The order of precedence is the docker.yml file and then environment variables. diff --git a/docs/docsite/rst/scenario_guides/guide_infoblox.rst b/docs/docsite/rst/scenario_guides/guide_infoblox.rst index 338e1981b6f..2fa90703a7e 100644 --- a/docs/docsite/rst/scenario_guides/guide_infoblox.rst +++ b/docs/docsite/rst/scenario_guides/guide_infoblox.rst @@ -248,9 +248,9 @@ Dynamic inventory script You can use the Infoblox dynamic inventory script to import your network node inventory with Infoblox NIOS. To gather the inventory from Infoblox, you need two files: -- `infoblox.yaml `_ - A file that specifies the NIOS provider arguments and optional filters. +- `infoblox.yaml `_ - A file that specifies the NIOS provider arguments and optional filters. -- `infoblox.py `_ - The python script that retrieves the NIOS inventory. +- `infoblox.py `_ - The python script that retrieves the NIOS inventory. To use the Infoblox dynamic inventory script: diff --git a/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_external_doc_links.rst b/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_external_doc_links.rst index 632343fb70a..b50837dde4a 100644 --- a/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_external_doc_links.rst +++ b/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_external_doc_links.rst @@ -4,7 +4,6 @@ Other useful VMware resources ***************************** -* `PyVmomi Documentation `_ * `VMware API and SDK Documentation `_ * `VCSIM test container image `_ * `Ansible VMware community wiki page `_ diff --git a/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_requirements.rst b/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_requirements.rst index 367d90a238a..45e3ec8faa7 100644 --- a/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_requirements.rst +++ b/docs/docsite/rst/scenario_guides/vmware_scenarios/vmware_requirements.rst @@ -35,7 +35,7 @@ Installing vCenter SSL certificates for Ansible Installing ESXi SSL certificates for Ansible -------------------------------------------- -* Enable SSH Service on ESXi either by using Ansible VMware module `vmware_host_service_manager `_ or manually using vSphere Web interface. +* Enable SSH Service on ESXi either by using Ansible VMware module `vmware_host_service_manager `_ or manually using vSphere Web interface. * SSH to ESXi server using administrative credentials, and navigate to directory ``/etc/vmware/ssl`` diff --git a/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst b/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst index a42940a4142..e60fe1ca7c6 100644 --- a/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst +++ b/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst @@ -28,7 +28,7 @@ Ansible integrates seamlessly with `Cobbler `_, a Lin While primarily used to kickoff OS installations and manage DHCP and DNS, Cobbler has a generic layer that can represent data for multiple configuration management systems (even at the same time) and serve as a 'lightweight CMDB'. -To tie your Ansible inventory to Cobbler, copy `this script `_ to ``/etc/ansible`` and ``chmod +x`` the file. Run ``cobblerd`` any time you use Ansible and use the ``-i`` command line option (e.g. ``-i /etc/ansible/cobbler.py``) to communicate with Cobbler using Cobbler's XMLRPC API. +To tie your Ansible inventory to Cobbler, copy `this script `_ to ``/etc/ansible`` and ``chmod +x`` the file. Run ``cobblerd`` any time you use Ansible and use the ``-i`` command line option (e.g. ``-i /etc/ansible/cobbler.py``) to communicate with Cobbler using Cobbler's XMLRPC API. Add a ``cobbler.ini`` file in ``/etc/ansible`` so Ansible knows where the Cobbler server is and some cache improvements can be used. For example: @@ -111,7 +111,7 @@ So in other words, you can use those variables in arguments/actions as well. Inventory script example: AWS EC2 ================================= -If you use Amazon Web Services EC2, maintaining an inventory file might not be the best approach, because hosts may come and go over time, be managed by external applications, or you might even be using AWS autoscaling. For this reason, you can use the `EC2 external inventory `_ script. +If you use Amazon Web Services EC2, maintaining an inventory file might not be the best approach, because hosts may come and go over time, be managed by external applications, or you might even be using AWS autoscaling. For this reason, you can use the `EC2 external inventory `_ script. You can use this script in one of two ways. The easiest is to use Ansible's ``-i`` command line option and specify the path to the script after marking it executable: @@ -119,7 +119,7 @@ You can use this script in one of two ways. The easiest is to use Ansible's ``-i ansible -i ec2.py -u ubuntu us-east-1d -m ping -The second option is to copy the script to `/etc/ansible/hosts` and `chmod +x` it. You must also copy the `ec2.ini `_ file to `/etc/ansible/ec2.ini`. Then you can run ansible as you would normally. +The second option is to copy the script to `/etc/ansible/hosts` and `chmod +x` it. You must also copy the `ec2.ini `_ file to `/etc/ansible/ec2.ini`. Then you can run ansible as you would normally. To make a successful API call to AWS, you must configure Boto (the Python interface to AWS). You can do this in `several ways `_ available, but the simplest is to export two environment variables: @@ -133,7 +133,7 @@ You can test the script by itself to make sure your config is correct: .. code-block:: bash cd /etc/ansible/ - wget https://raw.githubusercontent.com/ansible-collections/community.aws/master/scripts/inventory/ec2.py + wget https://raw.githubusercontent.com/ansible-collections/community.aws/main/scripts/inventory/ec2.py ./ec2.py --list After a few moments, you should see your entire EC2 inventory across all regions in JSON. @@ -254,7 +254,7 @@ To see the complete list of variables available for an instance, run the script .. code-block:: bash cd /etc/ansible - wget https://raw.githubusercontent.com/ansible-collections/community.aws/master/scripts/inventory/ec2.py + wget https://raw.githubusercontent.com/ansible-collections/community.aws/main/scripts/inventory/ec2.py ./ec2.py --host ec2-12-12-12-12.compute-1.amazonaws.com Note that the AWS inventory script will cache results to avoid repeated API calls, and this cache setting is configurable in ec2.ini. To