> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/ansible/tutorials/07__introducing_the_application_load_balancer/03__configure_app_servers.yml.md).

# 03\_\_configure\_app\_servers.yml.md

The source files for this tutorial can be downloaded from its [GitHub repository](https://github.com/ionos-cloud/module-ansible/tree/master/docs/), or cloned into your current working directory using the command `git clone https://github.com/ionos-cloud/module-ansible.git` before changing into the `module-ansible/docs/tutorials/07__introducing_the_application_load_balancer` sub-directory.

{% code title="01\_\_create\_jumpbox\_and\_nlb.yml" overflow="wrap" lineNumbers="true" %}

```
# Arguably not the most robust solution, but while an approach based upon,
# say, https://stackoverflow.com/a/67379573 would guarantee the resulting
# file is always valid, assuming the level of indention doesn't change,
# the following is simpler, and doesn't remove any comments that said file
# might contain
- name: Add our default route to /etc/netplan/50-cloud-init.yaml to make it persistent
  blockinfile:
    path: /etc/netplan/50-cloud-init.yaml
    insertbefore: "match:"
    block: |
      {% filter indent(width=12, first=true) %}
      routes:
        - to: default
          via: 192.168.8.1
      {% endfilter %}


- name: Ensure 'DNS=212.227.123.16 212.227.123.17' is in the '[Resolve]' section of /etc/systemd/resolved.conf
  community.general.ini_file:
    path: /etc/systemd/resolved.conf
    section: Resolve
    option: DNS
    value: 212.227.123.16 212.227.123.17
    state: present


- name: Restart the systemd-resolved service
  ansible.builtin.service:
    name: systemd-resolved
    state: restarted




- name: Update repositories cache and upgrade the system
  ansible.builtin.apt:
    upgrade: dist
    update_cache: yes
    cache_valid_time: 3600


- name: Install nginx
  ansible.builtin.package:
    name:
      - nginx
    state: present


- name: And create our per-host index.html files on the remote servers
  ansible.builtin.template:
    src: templates/index.html.j2
    dest: /var/www/html/index.html
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/ansible/tutorials/07__introducing_the_application_load_balancer/03__configure_app_servers.yml.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
