Skip to content
Snippets Groups Projects
Commit bd7ff623 authored by fejao's avatar fejao
Browse files

Updated the README.md file

parent dd301148
No related merge requests found
Pipeline #38407 passed
Pipeline: c3infodesk-deployment

#38408

    ...@@ -80,7 +80,7 @@ The role dependencies are: ...@@ -80,7 +80,7 @@ The role dependencies are:
    And run the command: And run the command:
    ```bash ```bash
    ansible-playbook -i inventories/hosts playbooks/examples/example_04_docker_images.yml ansible-playbook -i inventories/hosts playbooks/example_c3infodesk_printer/c3infodesk_printer_03_docker_images.yml
    ``` ```
    - ### Setting your own example - ### Setting your own example
    ...@@ -103,40 +103,7 @@ The role dependencies are: ...@@ -103,40 +103,7 @@ The role dependencies are:
    ## Testing ## Testing
    You can test this locally using **DIND (docker in docker)** at your own computer using [ansible molecule](https://ansible.readthedocs.io/projects/molecule/installation/) For testing this role, please reference [how to use molecule tests](https://git.cccv.de/fejao/c3infodesk-deployment-role-docker-images/-/tree/main/molecule)
    - ### Testing requirements
    You need docker installed at your system and the [ansible molecule](https://ansible.readthedocs.io/projects/molecule/installation/).
    - #### Setting *DIND (docker in docker)*
    You might have to set *DIND (docker in docker)* at your system, for linux, you can create the file **/etc/docker/daemon.json**
    - ##### Enabling DIND at your system
    And add the content and restart docker.
    ```json
    {
    "exec-opts": ["native.cgroupdriver=systemd"],
    "features": {
    "buildkit": true
    },
    "experimental": true,
    "cgroup-parent": "docker.slice"
    }
    ```
    - ### Using the molecule tests
    - #### Configuring the *HOST_VAR_FILE_NAME* variable
    For using the molecule tests you should pass the **HOST_VAR_FILE_NAME** environment variable, or the default value for testing is: **example_printer.yml**
    For the values that can be used, you can lool at the files at the **inventories/host_vars** folder.
    - ##### Molecule test example
    Just go to the root of the role **roles/x3infodesk-deployment-role-dependencies** and run the command, here is an example for using the **HOST_VAR_FILE_NAME** as *example_buttons.yml*:
    ```bash
    HOST_VAR_FILE_NAME="example_buttons.yml" molecule test
    ```
    ## License ## License
    ......
    ## ansible molecule tests for role: docker_images # ansible molecule tests for role: docker_images
    ...@@ -7,6 +7,7 @@ It's allways a good idea to test your things. ...@@ -7,6 +7,7 @@ It's allways a good idea to test your things.
    With **ansible molecule** you can test your role locally without the need of using a **real server** but a local **docker container**. With **ansible molecule** you can test your role locally without the need of using a **real server** but a local **docker container**.
    ## Dependencies ## Dependencies
    - ### molecule - ### molecule
    ...@@ -34,9 +35,26 @@ With **ansible molecule** you can test your role locally without the need of usi ...@@ -34,9 +35,26 @@ With **ansible molecule** you can test your role locally without the need of usi
    ## Configuration ## Configuration
    There's not much for configuring for using the tests There's not much for configuring for using the tests
    ## Running the tests ## Running the tests
    For running the **molecule tests** you just need to run the command:
    - #### Configuring the *HOST_VAR_FILE_NAME* variable
    For using the molecule tests you should pass the **HOST_VAR_FILE_NAME** environment variable, or the default value for testing is: **example_printer.yml**
    For the values that can be used, you can lool at the files at the **inventories/host_vars** folder.
    - ##### Molecule test example
    Just go to the root of the role **roles/x3infodesk-deployment-role-dependencies** and run the command, here is an example for using the **HOST_VAR_FILE_NAME** as *example_buttons.yml*:
    ```bash ```bash
    molecule test HOST_VAR_FILE_NAME="example_buttons.yml" molecule test
    ``` ```
    ## License
    MIT / BSD
    ## Author Information
    [https://chaos.social/@fejao](https://chaos.social/@fejao)
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment