<commit_before>.. highlight:: plain

Advanced features
=================

Breakpoints
^^^^^^^^^^^

Advanced usage sometimes requires partial execution of the ospd playbook. This can be achieved with
`Ansible tags <http://docs.ansible.com/ansible/playbooks_tags.html>`_

Use `InfraRed` with ``--dry-run`` flag. Instead of executing ansible, this will only generate the required ansible input::

    ir-installer [...] ospd [...] --dry-run -o OUTPUT_FILE

Ansible will take the `yaml` file ``OUTPUT_FILE`` as ``--extra-vars`` input file.

List the available tags of the `ospd` playbooks::

    ansible-playbook -i hosts --extra-vars @OUTPUT_FILE playbooks/install.yml  --list-tags

Execute only the desired tags. For example, this will only install the undercloud and stop::

    ansible-playbook -i hosts --extra-vars @OUTPUT_FILE playbooks/install.yml --tags=undercloud


OverCloud Image Update
^^^^^^^^^^^^^^^^^^^^^^

OSPD creates the OverCloud nodes from images. These images should be recreated on any new core build.
However, this is not always the case. To updates that image's packages
(after download and before deploying the Overcloud),  to match RH-OSP core bits ``build``,
set ``--images-update`` to ``yes``::

  ir-installer [...] ospd [...] --images-update=yes

.. note:: This might take a while and sometimes hangs. Probably due to old libguestfs packages in RHEL 7.2.
 For a more detailed console output of that task, set ``--images-update`` to ``verbose``.

Custom repositories
^^^^^^^^^^^^^^^^^^^

Infrared allows to add custom repositories to the UnderCloud when you're running `OSPD`, after installing the default repositories of the `OSPD` release.
This can be done passing through ``--extra-vars`` with the following key:
    * ``ospd.extra_repos.from_url`` which will download a repo file to ``/etc/yum.repos.d``
..    * ospd.extra_repos.from_config which will setup a repo using the ansible yum_repository module

.. .. note:: Since both options hold a list, you must create a yaml file in both cases to pass in the extra-vars option.

#. Using ``ospd.extra_repos.from_url``:
<commit_msg>Update Breakpoints documentation to new CLI<commit_after>.. highlight:: plain

Advanced features
=================

Tags
^^^^

Advanced usage sometimes requires partial execution of the ospd playbook. This can be achieved with
`Ansible tags <http://docs.ansible.com/ansible/playbooks_tags.html>`_

List the available tags of the `ospd` playbooks::

    ir-installer [...] ospd [...] --ansible-args list-tags

Execute only the desired tags. For example, this will only install the UnderCloud and download OverCloud images::

    ir-installer [...] ospd [...] --ansible-args "tags=undercloud,images"


Breakpoints
-----------
Commonly used tags:

undercloud
    Install the UnderCloud.
images
    Download OverCloud images and upload them to UnderCloud's Glance service.
introspection
    Create ``instackenv.json`` file and perform introspection on OverCloud nodes with Ironic.
tagging
    Tag Ironic nodes with OverCloud properties.
overcloud_init
    Generate heat-templates from user provided ``deployement-files`` and from input data.
    Create the ``overcloud_deploy.sh`` accordingly.
overcloud_deploy
    Execute ``overcloud_deploy.sh`` script
overcloud
    Do ``overcloud_init`` and ``overcloud_deploy``.
inventory_update
    Update Ansible inventory and SSH tunneling with new OverCloud nodes details (user, password, keys, etc...)

Common use case of tags is to stop after a certain stage is completed.
To do this, Ansible requires **a list of all the tags up to, and including the last desired stage**.
Therefore, in order to stop after UnderCloud is ready::

  ir-installer [...] ospd [...] --ansible-args --ansible-args tags="init,dump_facts,undercloud"

Or, in as a bash script, to stop after ``$BREAKPOINT``:

.. code-block:: bash

  FULL_TAG_LIST=init,dump_facts,undercloud,virthost,images,introspection,tagging,overcloud,inventory_update
  LEADING=`echo $FULL_TAG_LIST | awk -F$BREAKPOINT '{print $1}'`
  ir-installer [...] ospd [...] --ansible-args --ansible-args tags=${LEADING}${BREAKPOINT}


OverCloud Image Update
^^^^^^^^^^^^^^^^^^^^^^

OSPD creates the OverCloud nodes from images. These images should be recreated on any new core build.
However, this is not always the case. To updates that image's packages
(after download and before deploying the Overcloud),  to match RH-OSP core bits ``build``,
set ``--images-update`` to ``yes``::

  ir-installer [...] ospd [...] --images-update=yes

.. note:: This might take a while and sometimes hangs. Probably due to old libguestfs packages in RHEL 7.2.
 For a more detailed console output of that task, set ``--images-update`` to ``verbose``.

Custom repositories
^^^^^^^^^^^^^^^^^^^

Infrared allows to add custom repositories to the UnderCloud when you're running `OSPD`, after installing the default repositories of the `OSPD` release.
This can be done passing through ``--extra-vars`` with the following key:
    * ``ospd.extra_repos.from_url`` which will download a repo file to ``/etc/yum.repos.d``
..    * ospd.extra_repos.from_config which will setup a repo using the ansible yum_repository module

.. .. note:: Since both options hold a list, you must create a yaml file in both cases to pass in the extra-vars option.

#. Using ``ospd.extra_repos.from_url``:

{'fraction_non_alphanumeric': 0.1237845923709798, 'fraction_numerical': 0.0009349289454001496, 'mean_word_length': 4.163127413127413, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2938806', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1476, 'n_words': 629}