diff --git a/.gitignore b/.gitignore index bfd1b42a364..ad0d16a04ad 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ docs/docsite/rst/cli/ansible-*.rst docs/docsite/rst/cli/ansible.rst docs/docsite/rst/dev_guide/collections_galaxy_meta.rst docs/docsite/rst/dev_guide/testing/sanity/index.rst.new +docs/docsite/rst/dev_guide/index.rst docs/docsite/rst/modules/*.rst docs/docsite/rst/collections/*.rst !docs/docsite/rst/collections/all_plugins.rst diff --git a/MANIFEST.in b/MANIFEST.in index 294aa822b17..9495469bd26 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,6 +7,7 @@ include docs/docsite/rst/collections/all_plugins.rst exclude docs/docsite/rst_warnings exclude docs/docsite/rst/conf.py exclude docs/docsite/rst/index.rst +exclude docs/docsite/rst/dev_guide/index.rst exclude docs/docsite/rst/dev_guide/testing/sanity/bin-symlinks.rst exclude docs/docsite/rst/dev_guide/testing/sanity/botmeta.rst exclude docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst diff --git a/docs/docsite/Makefile b/docs/docsite/Makefile index deb0d6134c6..b511380af16 100644 --- a/docs/docsite/Makefile +++ b/docs/docsite/Makefile @@ -83,6 +83,7 @@ ansible_structure: if python -c "import sys, packaging.version as p; sys.exit(not p.Version('$(MAJOR_VERSION)') > p.Version('2.10'))" ; then \ echo "Creating symlinks in ansible_structure"; \ ln -sf ../rst/ansible_index.rst rst/index.rst; \ + ln -sf ../dev_guide/ansible_index.rst rst/dev_guide/index.rst; \ ln -sf ../sphinx_conf/ansible_conf.py rst/conf.py; \ else \ echo 'Creating symlinks for older ansible in ansible_structure'; \ @@ -94,12 +95,14 @@ ansible_structure: core_structure: @echo "Creating symlinks in core_structure" -ln -sf ../rst/core_index.rst rst/index.rst + -ln -sf ../dev_guide/core_index.rst rst/dev_guide/index.rst -ln -sf ../sphinx_conf/core_conf.py rst/conf.py # Symlink the relevant index into place for building core docs gettext_structure: @echo "Creating symlinks in gettext_structure" -ln -sf ../rst/core_index.rst rst/index.rst + -ln -sf ../rst/dev_guide/core_index.rst rst/dev_guide/index.rst -ln -sf ../sphinx_conf/all_conf.py rst/conf.py gettext: gettext_structure gettext_generate_rst diff --git a/docs/docsite/rst/dev_guide/index.rst b/docs/docsite/rst/dev_guide/ansible_index.rst similarity index 100% rename from docs/docsite/rst/dev_guide/index.rst rename to docs/docsite/rst/dev_guide/ansible_index.rst diff --git a/docs/docsite/rst/dev_guide/core_index.rst b/docs/docsite/rst/dev_guide/core_index.rst new file mode 100644 index 00000000000..6c479e973b6 --- /dev/null +++ b/docs/docsite/rst/dev_guide/core_index.rst @@ -0,0 +1,89 @@ +.. _developer_guide: + +*************** +Developer Guide +*************** + +.. note:: + + **Making Open Source More Inclusive** + + Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. We ask that you open an issue or pull request if you come upon a term that we have missed. For more details, see `our CTO Chris Wright's message `_. + +Welcome to the Ansible Developer Guide! + +**Who should use this guide?** + +If you want to extend Ansible by using a custom module or plugin locally, creating a module or plugin, adding functionality to an existing module, or expanding test coverage, this guide is for you. We've included detailed information for developers on how to test and document modules, as well as the prerequisites for getting your module or plugin accepted into the main Ansible repository. + +Find the task that best describes what you want to do: + +* I'm looking for a way to address a use case: + + * I want to :ref:`add a custom plugin or module locally `. + * I want to figure out if :ref:`developing a module is the right approach ` for my use case. + * I want to :ref:`develop a collection `. + * I want to :ref:`contribute to an Ansible-maintained collection `. + * I want to :ref:`contribute to a community-maintained collection `. + * I want to :ref:`migrate a role to a collection `. + +* I've read the info above, and I'm sure I want to develop a module: + + * What do I need to know before I start coding? + * I want to :ref:`set up my Python development environment `. + * I want to :ref:`get started writing a module `. + * I want to write a specific kind of module: + * a :ref:`network module ` + * a :ref:`Windows module `. + * I want to :ref:`write a series of related modules ` that integrate Ansible with a new product (for example, a database, cloud provider, network platform, and so on). + +* I want to refine my code: + + * I want to :ref:`debug my module code `. + * I want to :ref:`add tests `. + * I want to :ref:`document my module `. + * I want to :ref:`document my set of modules for a network platform `. + * I want to follow :ref:`conventions and tips for clean, usable module code `. + * I want to :ref:`make sure my code runs on Python 2 and Python 3 `. + +* I want to work on other development projects: + + * I want to :ref:`write a plugin `. + * I want to :ref:`connect Ansible to a new source of inventory `. + * I want to :ref:`deprecate an outdated module `. + +* I want to contribute back to the Ansible project: + + * I want to :ref:`understand how to contribute to Ansible `. + * I want to :ref:`contribute my module or plugin `. + * I want to :ref:`understand the license agreement ` for contributions to Ansible. + +If you prefer to read the entire guide, here's a list of the pages in order. + +.. toctree:: + :maxdepth: 2 + + developing_locally + developing_modules + developing_modules_general + developing_modules_checklist + developing_modules_best_practices + developing_python_3 + debugging + developing_modules_documenting + developing_modules_general_windows + developing_modules_general_aci + developing_modules_in_groups + testing + module_lifecycle + developing_plugins + developing_inventory + developing_core + developing_program_flow_modules + developing_api + developing_rebasing + developing_module_utilities + developing_collections + migrating_roles + collections_galaxy_meta + overview_architecture diff --git a/docs/docsite/sphinx_conf/ansible_conf.py b/docs/docsite/sphinx_conf/ansible_conf.py index 8c6c895c826..71b804e7c02 100644 --- a/docs/docsite/sphinx_conf/ansible_conf.py +++ b/docs/docsite/sphinx_conf/ansible_conf.py @@ -94,6 +94,8 @@ exclude_patterns = [ '2.10_index.rst', 'ansible_index.rst', 'core_index.rst', + 'dev_guide/ansible_index.rst', + 'dev_guide/core_index.rst', 'dev_guide/core_branches_and_tags.rst', 'porting_guides/core_porting_guides.rst', 'porting_guides/porting_guide_base_2.10.rst', diff --git a/docs/docsite/sphinx_conf/core_conf.py b/docs/docsite/sphinx_conf/core_conf.py index 1eb96bdd083..1cf3fe333a8 100644 --- a/docs/docsite/sphinx_conf/core_conf.py +++ b/docs/docsite/sphinx_conf/core_conf.py @@ -121,6 +121,13 @@ exclude_patterns = [ 'community/steering/steering_committee_membership.rst', 'community/steering/steering_committee_past_members.rst', 'community/steering/steering_index.rst', + 'dev_guide/ansible_index.rst', + 'dev_guide/core_index.rst', + 'dev_guide/platforms/aws_guidelines.rst', + 'dev_guide/platforms/openstack_guidelines.rst', + 'dev_guide/platforms/ovirt_dev_guide.rst', + 'dev_guide/platforms/vmware_guidelines.rst', + 'dev_guide/platforms/vmware_rest_guidelines.rst', 'porting_guides/porting_guides.rst', 'porting_guides/porting_guide_[1-9]*', 'roadmap/index.rst', diff --git a/test/sanity/code-smell/package-data.py b/test/sanity/code-smell/package-data.py index e707b0eb4f5..0c6e76134e4 100644 --- a/test/sanity/code-smell/package-data.py +++ b/test/sanity/code-smell/package-data.py @@ -62,6 +62,7 @@ def assemble_files_to_ship(complete_file_list): # Generated as part of a build step 'docs/docsite/rst/conf.py', 'docs/docsite/rst/index.rst', + 'docs/docsite/rst/dev_guide/index.rst', # Possibly should be included 'examples/scripts/uptime.py', 'examples/scripts/my_test.py',