-
Notifications
You must be signed in to change notification settings - Fork 144
Understanding how the Ansible docs build
There are many components to creating the Ansible documentation. This article attempts to start documenting some of these parts and pieces. It's a work in progress for sure, so don't take this all as proven fact just yet :-)
Ansible uses Sphinx to convert our rst files to html. Fairly straightforward, but the main file it uses to configure it all is conf.py. We won't repeat the Sphinx conf.py documentation, but we do make use of a few items that we describe later in order to create two docsites from the ansible/ansible Github repository.
Whether you are building locally, or triggering the internal to Red Hat build script that publishes to docs.ansible.com, the most common command you use is make webdocs
.
Prior to Ansible 2.10, make webdocs
was the main command to make all the documentation. In 2.10 and later, there are two commands:
-
make webdocs ANSIBLE_VERSION=[2.10,3,4]
- this chooses between building all the docs (for 2.10) or building the Ansible package docs for 3 or later. The main difference is 3 or later does not includeansible-core
roadmap or porting guides. If you don't select a version, it chooses the latest available from ansible-build-data. -
make coredocs
- Excludes network and scenario guides, and any Ansible package roadmap/porting guides.
This level of detail is mostly for the curious or anyone who has to change what and how these commands work. Feel free to ignore.
Not ignoring? Okay, let's take a walk through Makefiles and some python code.
In docs/docsite/ you'll see two makefiles:
-
Makefile - sets up what
make webdocs
andmake coredocs
do at the highest level. - Makefile.sphinx - sets up what Sphinx (the tool that converts our rst files to html) does.
There is also a section in the main Ansible Makefile make webdocs
etc that allows you to run the make
commands from the root directory instead of from docs/docsite
. If you add some new variant on making the docs, consider if you should also add that variant to the main Ansible Makefile as well. Otherwise your new variant only works from `docs/docsite/
There's quite a lot in this Makefile, but let's start with the basics. Starting in Ansible 2.10, we need to create two separate docsites effectively from the same set of .rst files. To do this, we use a few Sphinx and Makefile tricks:
- Use the
sphinx -c <path>
option for a separateconf.py
file to control the docsites and some other parameters. - Use exclude_pattern[] to exclude network, galaxy, and scenario guides and the individual porting guides and roadmap files from the appropriate sites.
- Use symlinks in the Makefile to link index.rst from either ansible_index file for ansible or core_index.rst for core.
This Wiki is used for quick notes, not for support or documentation.
Working groups are now in the Ansible forum
Ansible project:
Community,
Contributor Experience,
Docs,
News,
Outreach,
RelEng,
Testing
Cloud:
AWS,
Azure,
CloudStack,
Container,
DigitalOcean,
Docker,
hcloud,
Kubernetes,
Linode,
OpenStack,
oVirt,
Virt,
VMware
Networking:
ACI,
AVI,
F5,
Meraki,
Network,
NXOS
Ansible Developer Tools:
Ansible-developer-tools
Software:
Crypto,
Foreman,
GDrive,
GitLab,
Grafana,
IPA,
JBoss,
MongoDB,
MySQL,
PostgreSQL,
RabbitMQ,
Zabbix
System:
AIX,
BSD,
HP-UX,
macOS,
Remote Management,
Solaris,
Windows
Security:
Security-Automation,
Lockdown
Tooling:
AWX,
Galaxy,
Molecule
Plugins:
httpapi