From d3d1ff799022e65fd6df28925a7b3194efcf0d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Fri, 21 Sep 2018 18:43:56 +0200 Subject: [PATCH] Add a guide for using Online with Ansible (#45277) --- .../rst/scenario_guides/guide_online.rst | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docs/docsite/rst/scenario_guides/guide_online.rst diff --git a/docs/docsite/rst/scenario_guides/guide_online.rst b/docs/docsite/rst/scenario_guides/guide_online.rst new file mode 100644 index 00000000000..289fff8af8e --- /dev/null +++ b/docs/docsite/rst/scenario_guides/guide_online.rst @@ -0,0 +1,36 @@ +************************* +Using Ansible with Online +************************* + +Introduction +============ + +Online is a French hosting company mainly known for providing bare-metal servers named Dedibox. +Check it out: `https://www.online.net/en _` + +Dynamic inventory for Online resources +-------------------------------------- + +Ansible has a dynamic inventory plugin that can list your resources. + +1. Create a YAML configuration such as ``online_inventory.yml`` with this content: + +.. code-block:: yaml + + plugin: online + +2. Set your ``ONLINE_TOKEN`` environment variable with your token. + You need to open an account and log into it before you can get a token. + You can find your token at the following page: `https://console.online.net/en/api/access _` + +3. You can test that your inventory is working by running: ``ansible-inventory -v -i online_inventory.yml --list`` + +4. Now you can run your playbook or any other module with this inventory: + +:: + + $ ansible all -i online_inventory.yml -m ping + sd-96735 | SUCCESS => { + "changed": false, + "ping": "pong" + }