Skip to content

Add 12.4 task 4 #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: feature/module-development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions content/en/docs/12/04/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@ You can check the installation of your collection in the following ways:

{{% /details %}}


### Task 4 - Adding a new module

We will now proceed to add the `schroedingers_cat` module from the previous chapter to the collection.

Can you add id such that you can use it with the `ansible-doc` command using its fully qualified name `training.labs.schroedingers_cat`?

{{% details title="Solution Task 4" %}}

We must place the module inside the `plugins/modules` folder of the collection:
```bash
cp ~/techlab/ansible-module-development/library/schroedingers_cat.py ./training.labs/plugins/modules/schroedingers_cat.py
```

Now we can proceed to verify it:
```bash
ansible-doc training.labs.schroedingers_cat
```

{{% /details %}}

### All done?

* Have a look at the file structure of the newly created collection in the `training.labs` folder. Try to understand the structure, you can use the [Ansible Collection structure documentation](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_structure.html#collection-structure) to learn more about the structure.